Skip to content

Commit 2356ce0

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 43dcf2f commit 2356ce0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lightning/src/onion_message/messenger.rs

+16
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,22 @@ pub struct PendingOnionMessage<T: OnionMessageContents> {
417417
pub reply_path: Option<BlindedMessagePath>,
418418
}
419419

420+
/// A placeholder value used for paths within the codebase.
421+
///
422+
/// PATHS_PLACEHOLDER` is temporarily used as a default value in situations
423+
/// where a path index is required but has not yet been assigned or initialized.
424+
pub const PATHS_PLACEHOLDER: usize = 0;
425+
426+
/// Represents the types of [`BlindedPath`] that can be created.
427+
///
428+
/// This struct allows to specify the properties of a Blinded Path before creating it.
429+
pub struct BlindedPathParams {
430+
/// Number of [`BlindedPath`]s to be created.
431+
pub paths: usize,
432+
/// Whether the created [`BlindedPath`]s are full-length or compact.
433+
pub is_compact: bool,
434+
}
435+
420436
#[cfg(c_bindings)]
421437
/// An [`OnionMessage`] for [`OnionMessenger`] to send.
422438
///

0 commit comments

Comments
 (0)