@@ -30,6 +30,7 @@ use lightning::ln::channelmanager::ChannelManager;
30
30
use lightning:: ln:: msgs:: { ChannelMessageHandler , OnionMessageHandler , RoutingMessageHandler } ;
31
31
use lightning:: ln:: peer_handler:: { CustomMessageHandler , PeerManager , SocketDescriptor } ;
32
32
use lightning:: routing:: gossip:: { NetworkGraph , P2PGossipSync } ;
33
+ use lightning:: routing:: utxo:: UtxoLookup ;
33
34
use lightning:: routing:: router:: Router ;
34
35
use lightning:: routing:: scoring:: { Score , WriteableScore } ;
35
36
use lightning:: util:: events:: { Event , EventHandler , EventsProvider } ;
@@ -116,13 +117,13 @@ const FIRST_NETWORK_PRUNE_TIMER: u64 = 1;
116
117
117
118
/// Either [`P2PGossipSync`] or [`RapidGossipSync`].
118
119
pub enum GossipSync <
119
- P : Deref < Target = P2PGossipSync < G , A , L > > ,
120
+ P : Deref < Target = P2PGossipSync < G , U , L > > ,
120
121
R : Deref < Target = RapidGossipSync < G , L > > ,
121
122
G : Deref < Target = NetworkGraph < L > > ,
122
- A : Deref ,
123
+ U : Deref ,
123
124
L : Deref ,
124
125
>
125
- where A :: Target : chain :: Access , L :: Target : Logger {
126
+ where U :: Target : UtxoLookup , L :: Target : Logger {
126
127
/// Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
127
128
P2P ( P ) ,
128
129
/// Rapid gossip sync from a trusted server.
@@ -132,13 +133,13 @@ where A::Target: chain::Access, L::Target: Logger {
132
133
}
133
134
134
135
impl <
135
- P : Deref < Target = P2PGossipSync < G , A , L > > ,
136
+ P : Deref < Target = P2PGossipSync < G , U , L > > ,
136
137
R : Deref < Target = RapidGossipSync < G , L > > ,
137
138
G : Deref < Target = NetworkGraph < L > > ,
138
- A : Deref ,
139
+ U : Deref ,
139
140
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 {
142
143
fn network_graph ( & self ) -> Option < & G > {
143
144
match self {
144
145
GossipSync :: P2P ( gossip_sync) => Some ( gossip_sync. network_graph ( ) ) ,
@@ -163,10 +164,10 @@ where A::Target: chain::Access, L::Target: Logger {
163
164
}
164
165
165
166
/// (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 >
168
169
where
169
- A :: Target : chain :: Access ,
170
+ U :: Target : UtxoLookup ,
170
171
L :: Target : Logger ,
171
172
{
172
173
/// Initializes a new [`GossipSync::P2P`] variant.
@@ -178,10 +179,10 @@ where
178
179
/// (C-not exported) as the bindings concretize everything and have constructors for us
179
180
impl < ' a , R : Deref < Target = RapidGossipSync < G , L > > , G : Deref < Target = NetworkGraph < L > > , L : Deref >
180
181
GossipSync <
181
- & P2PGossipSync < G , & ' a ( dyn chain :: Access + Send + Sync ) , L > ,
182
+ & P2PGossipSync < G , & ' a ( dyn UtxoLookup + Send + Sync ) , L > ,
182
183
R ,
183
184
G ,
184
- & ' a ( dyn chain :: Access + Send + Sync ) ,
185
+ & ' a ( dyn UtxoLookup + Send + Sync ) ,
185
186
L ,
186
187
>
187
188
where
@@ -196,10 +197,10 @@ where
196
197
/// (C-not exported) as the bindings concretize everything and have constructors for us
197
198
impl < ' a , L : Deref >
198
199
GossipSync <
199
- & P2PGossipSync < & ' a NetworkGraph < L > , & ' a ( dyn chain :: Access + Send + Sync ) , L > ,
200
+ & P2PGossipSync < & ' a NetworkGraph < L > , & ' a ( dyn UtxoLookup + Send + Sync ) , L > ,
200
201
& RapidGossipSync < & ' a NetworkGraph < L > , L > ,
201
202
& ' a NetworkGraph < L > ,
202
- & ' a ( dyn chain :: Access + Send + Sync ) ,
203
+ & ' a ( dyn UtxoLookup + Send + Sync ) ,
203
204
L ,
204
205
>
205
206
where
@@ -397,7 +398,7 @@ macro_rules! define_run_body {
397
398
#[ cfg( feature = "futures" ) ]
398
399
pub async fn process_events_async <
399
400
' a ,
400
- CA : ' static + Deref + Send + Sync ,
401
+ UL : ' static + Deref + Send + Sync ,
401
402
CF : ' static + Deref + Send + Sync ,
402
403
CW : ' static + Deref + Send + Sync ,
403
404
T : ' static + Deref + Send + Sync ,
@@ -418,7 +419,7 @@ pub async fn process_events_async<
418
419
PS : ' static + Deref + Send ,
419
420
M : ' static + Deref < Target = ChainMonitor < <SP :: Target as SignerProvider >:: Signer , CF , T , F , L , P > > + Send + Sync ,
420
421
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 ,
422
423
RGS : ' static + Deref < Target = RapidGossipSync < G , L > > + Send ,
423
424
UMH : ' static + Deref + Send + Sync ,
424
425
PM : ' static + Deref < Target = PeerManager < Descriptor , CMH , RMH , OMH , L , UMH , NS > > + Send + Sync ,
@@ -428,11 +429,11 @@ pub async fn process_events_async<
428
429
Sleeper : Fn ( Duration ) -> SleepFuture
429
430
> (
430
431
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 > ,
432
433
sleeper : Sleeper ,
433
434
) -> Result < ( ) , io:: Error >
434
435
where
435
- CA :: Target : ' static + chain :: Access ,
436
+ UL :: Target : ' static + UtxoLookup ,
436
437
CF :: Target : ' static + chain:: Filter ,
437
438
CW :: Target : ' static + chain:: Watch < <SP :: Target as SignerProvider >:: Signer > ,
438
439
T :: Target : ' static + BroadcasterInterface ,
@@ -531,7 +532,7 @@ impl BackgroundProcessor {
531
532
/// [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
532
533
pub fn start <
533
534
' a ,
534
- CA : ' static + Deref + Send + Sync ,
535
+ UL : ' static + Deref + Send + Sync ,
535
536
CF : ' static + Deref + Send + Sync ,
536
537
CW : ' static + Deref + Send + Sync ,
537
538
T : ' static + Deref + Send + Sync ,
@@ -551,18 +552,18 @@ impl BackgroundProcessor {
551
552
PS : ' static + Deref + Send ,
552
553
M : ' static + Deref < Target = ChainMonitor < <SP :: Target as SignerProvider >:: Signer , CF , T , F , L , P > > + Send + Sync ,
553
554
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 ,
555
556
RGS : ' static + Deref < Target = RapidGossipSync < G , L > > + Send ,
556
557
UMH : ' static + Deref + Send + Sync ,
557
558
PM : ' static + Deref < Target = PeerManager < Descriptor , CMH , RMH , OMH , L , UMH , NS > > + Send + Sync ,
558
559
S : ' static + Deref < Target = SC > + Send + Sync ,
559
560
SC : for < ' b > WriteableScore < ' b > ,
560
561
> (
561
562
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 > ,
563
564
) -> Self
564
565
where
565
- CA :: Target : ' static + chain :: Access ,
566
+ UL :: Target : ' static + UtxoLookup ,
566
567
CF :: Target : ' static + chain:: Filter ,
567
568
CW :: Target : ' static + chain:: Watch < <SP :: Target as SignerProvider >:: Signer > ,
568
569
T :: Target : ' static + BroadcasterInterface ,
0 commit comments