Skip to content

Commit 5c1af89

Browse files
committed
Introduce BlindedPathParams
1. Added a new struct called `BlindedPathParams` to encapsulate multiple properties that define a blinded path. 2. These properties include the number of paths, the compactness of the path, and the number of hops. 3. This struct provides a systematic way for users to specify these properties before creating a blinded path, offering more flexibility and control. 4. In this version, the struct supports two properties: - The number of paths to generate. - Whether the path should be compact or not. 5. The ability to specify the number of hops will be introduced in a future update.
1 parent b023eed commit 5c1af89

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lightning/src/onion_message/messenger.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,22 @@ pub enum MessageSendInstructions {
432432
},
433433
}
434434

435+
/// A placeholder value used for paths within the codebase.
436+
///
437+
/// PATHS_PLACEHOLDER` is temporarily used as a default value in situations
438+
/// where a path index is required but has not yet been assigned or initialized.
439+
pub const PATHS_PLACEHOLDER: usize = 0;
440+
441+
/// Represents the types of [`BlindedMessagePath`] that can be created.
442+
///
443+
/// This struct allows to specify the properties of a Blinded Path before creating it.
444+
pub struct BlindedPathParams {
445+
/// Number of [`BlindedMessagePath`]s to be created.
446+
pub paths: usize,
447+
/// Whether the created [`BlindedMessagePath`]s are full-length or compact.
448+
pub is_compact: bool,
449+
}
450+
435451
/// A trait defining behavior for routing an [`OnionMessage`].
436452
pub trait MessageRouter {
437453
/// Returns a route for sending an [`OnionMessage`] to the given [`Destination`].

0 commit comments

Comments
 (0)