@@ -319,10 +319,7 @@ impl MaybeReadable for NetworkUpdate {
319319/// This network graph is then used for routing payments.
320320/// Provides interface to help with initial routing sync by
321321/// serving historical announcements.
322- pub struct P2PGossipSync < G : Deref < Target = NetworkGraph < L > > , U : Deref , L : Logger >
323- where
324- U :: Target : UtxoLookup ,
325- {
322+ pub struct P2PGossipSync < G : Deref < Target = NetworkGraph < L > > , U : UtxoLookup , L : Logger > {
326323 network_graph : G ,
327324 #[ cfg( any( feature = "_test_utils" , test) ) ]
328325 pub ( super ) utxo_lookup : Option < U > ,
@@ -333,10 +330,7 @@ where
333330 logger : L ,
334331}
335332
336- impl < G : Deref < Target = NetworkGraph < L > > , U : Deref , L : Logger > P2PGossipSync < G , U , L >
337- where
338- U :: Target : UtxoLookup ,
339- {
333+ impl < G : Deref < Target = NetworkGraph < L > > , U : UtxoLookup , L : Logger > P2PGossipSync < G , U , L > {
340334 /// Creates a new tracker of the actual state of the network of channels and nodes,
341335 /// assuming an existing [`NetworkGraph`].
342336 ///
@@ -534,10 +528,8 @@ pub fn verify_channel_announcement<C: Verification>(
534528 Ok ( ( ) )
535529}
536530
537- impl < G : Deref < Target = NetworkGraph < L > > , U : Deref , L : Logger > RoutingMessageHandler
531+ impl < G : Deref < Target = NetworkGraph < L > > , U : UtxoLookup , L : Logger > RoutingMessageHandler
538532 for P2PGossipSync < G , U , L >
539- where
540- U :: Target : UtxoLookup ,
541533{
542534 fn handle_node_announcement (
543535 & self , _their_node_id : Option < PublicKey > , msg : & msgs:: NodeAnnouncement ,
@@ -761,10 +753,8 @@ where
761753 }
762754}
763755
764- impl < G : Deref < Target = NetworkGraph < L > > , U : Deref , L : Logger > BaseMessageHandler
756+ impl < G : Deref < Target = NetworkGraph < L > > , U : UtxoLookup , L : Logger > BaseMessageHandler
765757 for P2PGossipSync < G , U , L >
766- where
767- U :: Target : UtxoLookup ,
768758{
769759 /// Initiates a stateless sync of routing gossip information with a peer
770760 /// using [`gossip_queries`]. The default strategy used by this implementation
@@ -1972,12 +1962,9 @@ impl<L: Logger> NetworkGraph<L> {
19721962 ///
19731963 /// If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
19741964 /// the corresponding UTXO exists on chain and is correctly-formatted.
1975- pub fn update_channel_from_announcement < U : Deref > (
1965+ pub fn update_channel_from_announcement < U : UtxoLookup > (
19761966 & self , msg : & msgs:: ChannelAnnouncement , utxo_lookup : & Option < U > ,
1977- ) -> Result < ( ) , LightningError >
1978- where
1979- U :: Target : UtxoLookup ,
1980- {
1967+ ) -> Result < ( ) , LightningError > {
19811968 self . pre_channel_announcement_validation_check ( & msg. contents , utxo_lookup) ?;
19821969 verify_channel_announcement ( msg, & self . secp_ctx ) ?;
19831970 self . update_channel_from_unsigned_announcement_intern ( & msg. contents , Some ( msg) , utxo_lookup)
@@ -2002,12 +1989,9 @@ impl<L: Logger> NetworkGraph<L> {
20021989 ///
20031990 /// If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
20041991 /// the corresponding UTXO exists on chain and is correctly-formatted.
2005- pub fn update_channel_from_unsigned_announcement < U : Deref > (
1992+ pub fn update_channel_from_unsigned_announcement < U : UtxoLookup > (
20061993 & self , msg : & msgs:: UnsignedChannelAnnouncement , utxo_lookup : & Option < U > ,
2007- ) -> Result < ( ) , LightningError >
2008- where
2009- U :: Target : UtxoLookup ,
2010- {
1994+ ) -> Result < ( ) , LightningError > {
20111995 self . pre_channel_announcement_validation_check ( & msg, utxo_lookup) ?;
20121996 self . update_channel_from_unsigned_announcement_intern ( msg, None , utxo_lookup)
20131997 }
@@ -2126,12 +2110,9 @@ impl<L: Logger> NetworkGraph<L> {
21262110 ///
21272111 /// In those cases, this will return an `Err` that we can return immediately. Otherwise it will
21282112 /// return an `Ok(())`.
2129- fn pre_channel_announcement_validation_check < U : Deref > (
2113+ fn pre_channel_announcement_validation_check < U : UtxoLookup > (
21302114 & self , msg : & msgs:: UnsignedChannelAnnouncement , utxo_lookup : & Option < U > ,
2131- ) -> Result < ( ) , LightningError >
2132- where
2133- U :: Target : UtxoLookup ,
2134- {
2115+ ) -> Result < ( ) , LightningError > {
21352116 let channels = self . channels . read ( ) . unwrap ( ) ;
21362117
21372118 if let Some ( chan) = channels. get ( & msg. short_channel_id ) {
@@ -2170,13 +2151,10 @@ impl<L: Logger> NetworkGraph<L> {
21702151 ///
21712152 /// Generally [`Self::pre_channel_announcement_validation_check`] should have been called
21722153 /// first.
2173- fn update_channel_from_unsigned_announcement_intern < U : Deref > (
2154+ fn update_channel_from_unsigned_announcement_intern < U : UtxoLookup > (
21742155 & self , msg : & msgs:: UnsignedChannelAnnouncement ,
21752156 full_msg : Option < & msgs:: ChannelAnnouncement > , utxo_lookup : & Option < U > ,
2176- ) -> Result < ( ) , LightningError >
2177- where
2178- U :: Target : UtxoLookup ,
2179- {
2157+ ) -> Result < ( ) , LightningError > {
21802158 if msg. node_id_1 == msg. node_id_2 || msg. bitcoin_key_1 == msg. bitcoin_key_2 {
21812159 return Err ( LightningError {
21822160 err : "Channel announcement node had a channel with itself" . to_owned ( ) ,
0 commit comments