@@ -64,9 +64,9 @@ pub(super) const MAX_TIMER_TICKS: usize = 2;
64
64
/// # extern crate bitcoin;
65
65
/// # use bitcoin::hashes::_export::_core::time::Duration;
66
66
/// # use bitcoin::hashes::hex::FromHex;
67
- /// # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
67
+ /// # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self };
68
68
/// # use lightning::blinded_path::BlindedPath;
69
- /// # use lightning::sign::KeysManager;
69
+ /// # use lightning::sign::{EntropySource, KeysManager} ;
70
70
/// # use lightning::ln::peer_handler::IgnoringMessageHandler;
71
71
/// # use lightning::onion_message::{OnionMessageContents, Destination, MessageRouter, OnionMessagePath, OnionMessenger};
72
72
/// # use lightning::util::logger::{Logger, Record};
@@ -90,6 +90,11 @@ pub(super) const MAX_TIMER_TICKS: usize = 2;
90
90
/// # first_node_addresses: None,
91
91
/// # })
92
92
/// # }
93
+ /// # fn create_blinded_paths<ES: EntropySource + ?Sized, T: secp256k1::Signing + secp256k1::Verification>(
94
+ /// # &self, _recipient: PublicKey, _peers: Vec<PublicKey>, _entropy_source: &ES, _secp_ctx: &Secp256k1<T>
95
+ /// # ) -> Result<Vec<BlindedPath>, ()> {
96
+ /// # unreachable!()
97
+ /// # }
93
98
/// # }
94
99
/// # let seed = [42u8; 32];
95
100
/// # let time = Duration::from_secs(123456);
@@ -273,20 +278,12 @@ pub trait MessageRouter {
273
278
274
279
/// Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be
275
280
/// direct peers with the `recipient`.
276
- ///
277
- /// The default implementation returns two-hop paths for each node in `peers` with the
278
- /// `recipient` node (i.e., the peer is the introduction point).
279
281
fn create_blinded_paths <
280
282
ES : EntropySource + ?Sized , T : secp256k1:: Signing + secp256k1:: Verification
281
283
> (
282
284
& self , recipient : PublicKey , peers : Vec < PublicKey > , entropy_source : & ES ,
283
285
secp_ctx : & Secp256k1 < T >
284
- ) -> Result < Vec < BlindedPath > , ( ) > {
285
- peers. into_iter ( )
286
- . map ( |hop| vec ! [ hop, recipient] )
287
- . map ( |node_pks| BlindedPath :: new_for_message ( & node_pks, entropy_source, secp_ctx) )
288
- . collect ( )
289
- }
286
+ ) -> Result < Vec < BlindedPath > , ( ) > ;
290
287
}
291
288
292
289
/// A [`MessageRouter`] that can only route to a directly connected [`Destination`].
@@ -338,6 +335,18 @@ where
338
335
}
339
336
}
340
337
}
338
+
339
+ fn create_blinded_paths <
340
+ ES : EntropySource + ?Sized , T : secp256k1:: Signing + secp256k1:: Verification
341
+ > (
342
+ & self , recipient : PublicKey , peers : Vec < PublicKey > , entropy_source : & ES ,
343
+ secp_ctx : & Secp256k1 < T >
344
+ ) -> Result < Vec < BlindedPath > , ( ) > {
345
+ peers. into_iter ( )
346
+ . map ( |hop| vec ! [ hop, recipient] )
347
+ . map ( |node_pks| BlindedPath :: new_for_message ( & node_pks, entropy_source, secp_ctx) )
348
+ . collect ( )
349
+ }
341
350
}
342
351
343
352
/// A path for sending an [`OnionMessage`].
0 commit comments