@@ -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
@@ -1951,12 +1941,9 @@ impl<L: Logger> NetworkGraph<L> {
19511941 ///
19521942 /// If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
19531943 /// the corresponding UTXO exists on chain and is correctly-formatted.
1954- pub fn update_channel_from_announcement < U : Deref > (
1944+ pub fn update_channel_from_announcement < U : UtxoLookup > (
19551945 & self , msg : & msgs:: ChannelAnnouncement , utxo_lookup : & Option < U > ,
1956- ) -> Result < ( ) , LightningError >
1957- where
1958- U :: Target : UtxoLookup ,
1959- {
1946+ ) -> Result < ( ) , LightningError > {
19601947 self . pre_channel_announcement_validation_check ( & msg. contents , utxo_lookup) ?;
19611948 verify_channel_announcement ( msg, & self . secp_ctx ) ?;
19621949 self . update_channel_from_unsigned_announcement_intern ( & msg. contents , Some ( msg) , utxo_lookup)
@@ -1981,12 +1968,9 @@ impl<L: Logger> NetworkGraph<L> {
19811968 ///
19821969 /// If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
19831970 /// the corresponding UTXO exists on chain and is correctly-formatted.
1984- pub fn update_channel_from_unsigned_announcement < U : Deref > (
1971+ pub fn update_channel_from_unsigned_announcement < U : UtxoLookup > (
19851972 & self , msg : & msgs:: UnsignedChannelAnnouncement , utxo_lookup : & Option < U > ,
1986- ) -> Result < ( ) , LightningError >
1987- where
1988- U :: Target : UtxoLookup ,
1989- {
1973+ ) -> Result < ( ) , LightningError > {
19901974 self . pre_channel_announcement_validation_check ( & msg, utxo_lookup) ?;
19911975 self . update_channel_from_unsigned_announcement_intern ( msg, None , utxo_lookup)
19921976 }
@@ -2105,12 +2089,9 @@ impl<L: Logger> NetworkGraph<L> {
21052089 ///
21062090 /// In those cases, this will return an `Err` that we can return immediately. Otherwise it will
21072091 /// return an `Ok(())`.
2108- fn pre_channel_announcement_validation_check < U : Deref > (
2092+ fn pre_channel_announcement_validation_check < U : UtxoLookup > (
21092093 & self , msg : & msgs:: UnsignedChannelAnnouncement , utxo_lookup : & Option < U > ,
2110- ) -> Result < ( ) , LightningError >
2111- where
2112- U :: Target : UtxoLookup ,
2113- {
2094+ ) -> Result < ( ) , LightningError > {
21142095 let channels = self . channels . read ( ) . unwrap ( ) ;
21152096
21162097 if let Some ( chan) = channels. get ( & msg. short_channel_id ) {
@@ -2149,13 +2130,10 @@ impl<L: Logger> NetworkGraph<L> {
21492130 ///
21502131 /// Generally [`Self::pre_channel_announcement_validation_check`] should have been called
21512132 /// first.
2152- fn update_channel_from_unsigned_announcement_intern < U : Deref > (
2133+ fn update_channel_from_unsigned_announcement_intern < U : UtxoLookup > (
21532134 & self , msg : & msgs:: UnsignedChannelAnnouncement ,
21542135 full_msg : Option < & msgs:: ChannelAnnouncement > , utxo_lookup : & Option < U > ,
2155- ) -> Result < ( ) , LightningError >
2156- where
2157- U :: Target : UtxoLookup ,
2158- {
2136+ ) -> Result < ( ) , LightningError > {
21592137 if msg. node_id_1 == msg. node_id_2 || msg. bitcoin_key_1 == msg. bitcoin_key_2 {
21602138 return Err ( LightningError {
21612139 err : "Channel announcement node had a channel with itself" . to_owned ( ) ,
0 commit comments