File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed
lightning/src/onion_message Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -432,12 +432,6 @@ pub enum MessageSendInstructions {
432
432
} ,
433
433
}
434
434
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
435
/// Represents the types of [`BlindedMessagePath`] that can be created.
442
436
///
443
437
/// This struct allows to specify the properties of a Blinded Path before creating it.
@@ -448,6 +442,27 @@ pub struct BlindedPathParams {
448
442
pub is_compact : bool ,
449
443
}
450
444
445
+ impl BlindedPathParams {
446
+ /// Number of paths to be calculated, used by default throughout the codebase.
447
+ const DEFAULT_PATHS : usize = 3 ;
448
+
449
+ /// Create [`BlindedPathParams`] with default number of paths.
450
+ pub fn new ( is_compact : bool ) -> Self {
451
+ Self {
452
+ paths : Self :: DEFAULT_PATHS ,
453
+ is_compact,
454
+ }
455
+ }
456
+
457
+ /// Create [`BlindedPathParams`] with custom number of paths.
458
+ pub fn new_with_paths ( paths : usize , is_compact : bool ) -> Self {
459
+ Self {
460
+ paths,
461
+ is_compact,
462
+ }
463
+ }
464
+ }
465
+
451
466
/// A trait defining behavior for routing an [`OnionMessage`].
452
467
pub trait MessageRouter {
453
468
/// Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
You can’t perform that action at this time.
0 commit comments