@@ -30,6 +30,7 @@ use lightning::ln::channelmanager::ChannelManager;
3030use lightning:: ln:: msgs:: { ChannelMessageHandler , OnionMessageHandler , RoutingMessageHandler } ;
3131use lightning:: ln:: peer_handler:: { CustomMessageHandler , PeerManager , SocketDescriptor } ;
3232use lightning:: routing:: gossip:: { NetworkGraph , P2PGossipSync } ;
33+ use lightning:: routing:: utxo:: UtxoLookup ;
3334use lightning:: routing:: router:: Router ;
3435use lightning:: routing:: scoring:: { Score , WriteableScore } ;
3536use lightning:: util:: events:: { Event , EventHandler , EventsProvider } ;
@@ -116,13 +117,13 @@ const FIRST_NETWORK_PRUNE_TIMER: u64 = 1;
116117
117118/// Either [`P2PGossipSync`] or [`RapidGossipSync`].
118119pub enum GossipSync <
119- P : Deref < Target = P2PGossipSync < G , A , L > > ,
120+ P : Deref < Target = P2PGossipSync < G , U , L > > ,
120121 R : Deref < Target = RapidGossipSync < G , L > > ,
121122 G : Deref < Target = NetworkGraph < L > > ,
122- A : Deref ,
123+ U : Deref ,
123124 L : Deref ,
124125>
125- where A :: Target : chain :: Access , L :: Target : Logger {
126+ where U :: Target : UtxoLookup , L :: Target : Logger {
126127 /// Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
127128 P2P ( P ) ,
128129 /// Rapid gossip sync from a trusted server.
@@ -132,13 +133,13 @@ where A::Target: chain::Access, L::Target: Logger {
132133}
133134
134135impl <
135- P : Deref < Target = P2PGossipSync < G , A , L > > ,
136+ P : Deref < Target = P2PGossipSync < G , U , L > > ,
136137 R : Deref < Target = RapidGossipSync < G , L > > ,
137138 G : Deref < Target = NetworkGraph < L > > ,
138- A : Deref ,
139+ U : Deref ,
139140 L : Deref ,
140- > GossipSync < P , R , G , A , L >
141- where A :: Target : chain :: Access , L :: Target : Logger {
141+ > GossipSync < P , R , G , U , L >
142+ where U :: Target : UtxoLookup , L :: Target : Logger {
142143 fn network_graph ( & self ) -> Option < & G > {
143144 match self {
144145 GossipSync :: P2P ( gossip_sync) => Some ( gossip_sync. network_graph ( ) ) ,
@@ -163,10 +164,10 @@ where A::Target: chain::Access, L::Target: Logger {
163164}
164165
165166/// (C-not exported) as the bindings concretize everything and have constructors for us
166- impl < P : Deref < Target = P2PGossipSync < G , A , L > > , G : Deref < Target = NetworkGraph < L > > , A : Deref , L : Deref >
167- GossipSync < P , & RapidGossipSync < G , L > , G , A , L >
167+ impl < P : Deref < Target = P2PGossipSync < G , U , L > > , G : Deref < Target = NetworkGraph < L > > , U : Deref , L : Deref >
168+ GossipSync < P , & RapidGossipSync < G , L > , G , U , L >
168169where
169- A :: Target : chain :: Access ,
170+ U :: Target : UtxoLookup ,
170171 L :: Target : Logger ,
171172{
172173 /// Initializes a new [`GossipSync::P2P`] variant.
@@ -178,10 +179,10 @@ where
178179/// (C-not exported) as the bindings concretize everything and have constructors for us
179180impl < ' a , R : Deref < Target = RapidGossipSync < G , L > > , G : Deref < Target = NetworkGraph < L > > , L : Deref >
180181 GossipSync <
181- & P2PGossipSync < G , & ' a ( dyn chain :: Access + Send + Sync ) , L > ,
182+ & P2PGossipSync < G , & ' a ( dyn UtxoLookup + Send + Sync ) , L > ,
182183 R ,
183184 G ,
184- & ' a ( dyn chain :: Access + Send + Sync ) ,
185+ & ' a ( dyn UtxoLookup + Send + Sync ) ,
185186 L ,
186187 >
187188where
@@ -196,10 +197,10 @@ where
196197/// (C-not exported) as the bindings concretize everything and have constructors for us
197198impl < ' a , L : Deref >
198199 GossipSync <
199- & P2PGossipSync < & ' a NetworkGraph < L > , & ' a ( dyn chain :: Access + Send + Sync ) , L > ,
200+ & P2PGossipSync < & ' a NetworkGraph < L > , & ' a ( dyn UtxoLookup + Send + Sync ) , L > ,
200201 & RapidGossipSync < & ' a NetworkGraph < L > , L > ,
201202 & ' a NetworkGraph < L > ,
202- & ' a ( dyn chain :: Access + Send + Sync ) ,
203+ & ' a ( dyn UtxoLookup + Send + Sync ) ,
203204 L ,
204205 >
205206where
@@ -397,7 +398,7 @@ macro_rules! define_run_body {
397398#[ cfg( feature = "futures" ) ]
398399pub async fn process_events_async <
399400 ' a ,
400- CA : ' static + Deref + Send + Sync ,
401+ UL : ' static + Deref + Send + Sync ,
401402 CF : ' static + Deref + Send + Sync ,
402403 CW : ' static + Deref + Send + Sync ,
403404 T : ' static + Deref + Send + Sync ,
@@ -418,7 +419,7 @@ pub async fn process_events_async<
418419 PS : ' static + Deref + Send ,
419420 M : ' static + Deref < Target = ChainMonitor < <SP :: Target as SignerProvider >:: Signer , CF , T , F , L , P > > + Send + Sync ,
420421 CM : ' static + Deref < Target = ChannelManager < CW , T , ES , NS , SP , F , R , L > > + Send + Sync ,
421- PGS : ' static + Deref < Target = P2PGossipSync < G , CA , L > > + Send + Sync ,
422+ PGS : ' static + Deref < Target = P2PGossipSync < G , UL , L > > + Send + Sync ,
422423 RGS : ' static + Deref < Target = RapidGossipSync < G , L > > + Send ,
423424 UMH : ' static + Deref + Send + Sync ,
424425 PM : ' static + Deref < Target = PeerManager < Descriptor , CMH , RMH , OMH , L , UMH , NS > > + Send + Sync ,
@@ -428,11 +429,11 @@ pub async fn process_events_async<
428429 Sleeper : Fn ( Duration ) -> SleepFuture
429430> (
430431 persister : PS , event_handler : EventHandler , chain_monitor : M , channel_manager : CM ,
431- gossip_sync : GossipSync < PGS , RGS , G , CA , L > , peer_manager : PM , logger : L , scorer : Option < S > ,
432+ gossip_sync : GossipSync < PGS , RGS , G , UL , L > , peer_manager : PM , logger : L , scorer : Option < S > ,
432433 sleeper : Sleeper ,
433434) -> Result < ( ) , io:: Error >
434435where
435- CA :: Target : ' static + chain :: Access ,
436+ UL :: Target : ' static + UtxoLookup ,
436437 CF :: Target : ' static + chain:: Filter ,
437438 CW :: Target : ' static + chain:: Watch < <SP :: Target as SignerProvider >:: Signer > ,
438439 T :: Target : ' static + BroadcasterInterface ,
@@ -531,7 +532,7 @@ impl BackgroundProcessor {
531532 /// [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
532533 pub fn start <
533534 ' a ,
534- CA : ' static + Deref + Send + Sync ,
535+ UL : ' static + Deref + Send + Sync ,
535536 CF : ' static + Deref + Send + Sync ,
536537 CW : ' static + Deref + Send + Sync ,
537538 T : ' static + Deref + Send + Sync ,
@@ -551,18 +552,18 @@ impl BackgroundProcessor {
551552 PS : ' static + Deref + Send ,
552553 M : ' static + Deref < Target = ChainMonitor < <SP :: Target as SignerProvider >:: Signer , CF , T , F , L , P > > + Send + Sync ,
553554 CM : ' static + Deref < Target = ChannelManager < CW , T , ES , NS , SP , F , R , L > > + Send + Sync ,
554- PGS : ' static + Deref < Target = P2PGossipSync < G , CA , L > > + Send + Sync ,
555+ PGS : ' static + Deref < Target = P2PGossipSync < G , UL , L > > + Send + Sync ,
555556 RGS : ' static + Deref < Target = RapidGossipSync < G , L > > + Send ,
556557 UMH : ' static + Deref + Send + Sync ,
557558 PM : ' static + Deref < Target = PeerManager < Descriptor , CMH , RMH , OMH , L , UMH , NS > > + Send + Sync ,
558559 S : ' static + Deref < Target = SC > + Send + Sync ,
559560 SC : for < ' b > WriteableScore < ' b > ,
560561 > (
561562 persister : PS , event_handler : EH , chain_monitor : M , channel_manager : CM ,
562- gossip_sync : GossipSync < PGS , RGS , G , CA , L > , peer_manager : PM , logger : L , scorer : Option < S > ,
563+ gossip_sync : GossipSync < PGS , RGS , G , UL , L > , peer_manager : PM , logger : L , scorer : Option < S > ,
563564 ) -> Self
564565 where
565- CA :: Target : ' static + chain :: Access ,
566+ UL :: Target : ' static + UtxoLookup ,
566567 CF :: Target : ' static + chain:: Filter ,
567568 CW :: Target : ' static + chain:: Watch < <SP :: Target as SignerProvider >:: Signer > ,
568569 T :: Target : ' static + BroadcasterInterface ,
0 commit comments