@@ -159,8 +159,7 @@ pub struct BlockHeaderData {
159159/// custom cache eviction policy. This offers flexibility to those sensitive to resource usage.
160160/// Hence, there is a trade-off between a lower memory footprint and potentially increased network
161161/// I/O as headers are re-fetched during fork detection.
162- pub struct SpvClient < ' a , P : Poll , C : Cache , L : Deref >
163- where L :: Target : chain:: Listen {
162+ pub struct SpvClient < ' a , P : Poll , C : Cache , L : chain:: Listen > {
164163 chain_tip : ValidatedBlockHeader ,
165164 chain_poller : P ,
166165 chain_notifier : ChainNotifier < ' a , C , L > ,
@@ -208,7 +207,7 @@ impl Cache for UnboundedCache {
208207 }
209208}
210209
211- impl < ' a , P : Poll , C : Cache , L : Deref > SpvClient < ' a , P , C , L > where L :: Target : chain :: Listen {
210+ impl < ' a , P : Poll , C : Cache , L : chain :: Listen > SpvClient < ' a , P , C , L > {
212211 /// Creates a new SPV client using `chain_tip` as the best known chain tip.
213212 ///
214213 /// Subsequent calls to [`poll_best_tip`] will poll for the best chain tip using the given chain
@@ -272,7 +271,7 @@ impl<'a, P: Poll, C: Cache, L: Deref> SpvClient<'a, P, C, L> where L::Target: ch
272271/// Notifies [listeners] of blocks that have been connected or disconnected from the chain.
273272///
274273/// [listeners]: ../../lightning/chain/trait.Listen.html
275- pub struct ChainNotifier < ' a , C : Cache , L : Deref > where L :: Target : chain:: Listen {
274+ pub struct ChainNotifier < ' a , C : Cache , L : chain:: Listen > {
276275 /// Cache for looking up headers before fetching from a block source.
277276 header_cache : & ' a mut C ,
278277
@@ -298,7 +297,7 @@ struct ChainDifference {
298297 connected_blocks : Vec < ValidatedBlockHeader > ,
299298}
300299
301- impl < ' a , C : Cache , L : Deref > ChainNotifier < ' a , C , L > where L :: Target : chain :: Listen {
300+ impl < ' a , C : Cache , L : chain :: Listen > ChainNotifier < ' a , C , L > {
302301 /// Finds the first common ancestor between `new_header` and `old_header`, disconnecting blocks
303302 /// from `old_header` to get to that point and then connecting blocks until `new_header`.
304303 ///
@@ -420,7 +419,7 @@ mod spv_client_tests {
420419 let poller = poll:: ChainPoller :: new ( & mut chain, Network :: Testnet ) ;
421420 let mut cache = UnboundedCache :: new ( ) ;
422421 let mut listener = NullChainListener { } ;
423- let mut client = SpvClient :: new ( best_tip, poller, & mut cache, & mut listener) ;
422+ let mut client = SpvClient :: new ( best_tip, poller, & mut cache, & listener) ;
424423 match client. poll_best_tip ( ) . await {
425424 Err ( e) => {
426425 assert_eq ! ( e. kind( ) , BlockSourceErrorKind :: Persistent ) ;
@@ -439,7 +438,7 @@ mod spv_client_tests {
439438 let poller = poll:: ChainPoller :: new ( & mut chain, Network :: Testnet ) ;
440439 let mut cache = UnboundedCache :: new ( ) ;
441440 let mut listener = NullChainListener { } ;
442- let mut client = SpvClient :: new ( common_tip, poller, & mut cache, & mut listener) ;
441+ let mut client = SpvClient :: new ( common_tip, poller, & mut cache, & listener) ;
443442 match client. poll_best_tip ( ) . await {
444443 Err ( e) => panic ! ( "Unexpected error: {:?}" , e) ,
445444 Ok ( ( chain_tip, blocks_connected) ) => {
@@ -459,7 +458,7 @@ mod spv_client_tests {
459458 let poller = poll:: ChainPoller :: new ( & mut chain, Network :: Testnet ) ;
460459 let mut cache = UnboundedCache :: new ( ) ;
461460 let mut listener = NullChainListener { } ;
462- let mut client = SpvClient :: new ( old_tip, poller, & mut cache, & mut listener) ;
461+ let mut client = SpvClient :: new ( old_tip, poller, & mut cache, & listener) ;
463462 match client. poll_best_tip ( ) . await {
464463 Err ( e) => panic ! ( "Unexpected error: {:?}" , e) ,
465464 Ok ( ( chain_tip, blocks_connected) ) => {
@@ -479,7 +478,7 @@ mod spv_client_tests {
479478 let poller = poll:: ChainPoller :: new ( & mut chain, Network :: Testnet ) ;
480479 let mut cache = UnboundedCache :: new ( ) ;
481480 let mut listener = NullChainListener { } ;
482- let mut client = SpvClient :: new ( old_tip, poller, & mut cache, & mut listener) ;
481+ let mut client = SpvClient :: new ( old_tip, poller, & mut cache, & listener) ;
483482 match client. poll_best_tip ( ) . await {
484483 Err ( e) => panic ! ( "Unexpected error: {:?}" , e) ,
485484 Ok ( ( chain_tip, blocks_connected) ) => {
@@ -499,7 +498,7 @@ mod spv_client_tests {
499498 let poller = poll:: ChainPoller :: new ( & mut chain, Network :: Testnet ) ;
500499 let mut cache = UnboundedCache :: new ( ) ;
501500 let mut listener = NullChainListener { } ;
502- let mut client = SpvClient :: new ( old_tip, poller, & mut cache, & mut listener) ;
501+ let mut client = SpvClient :: new ( old_tip, poller, & mut cache, & listener) ;
503502 match client. poll_best_tip ( ) . await {
504503 Err ( e) => panic ! ( "Unexpected error: {:?}" , e) ,
505504 Ok ( ( chain_tip, blocks_connected) ) => {
@@ -520,7 +519,7 @@ mod spv_client_tests {
520519 let poller = poll:: ChainPoller :: new ( & mut chain, Network :: Testnet ) ;
521520 let mut cache = UnboundedCache :: new ( ) ;
522521 let mut listener = NullChainListener { } ;
523- let mut client = SpvClient :: new ( best_tip, poller, & mut cache, & mut listener) ;
522+ let mut client = SpvClient :: new ( best_tip, poller, & mut cache, & listener) ;
524523 match client. poll_best_tip ( ) . await {
525524 Err ( e) => panic ! ( "Unexpected error: {:?}" , e) ,
526525 Ok ( ( chain_tip, blocks_connected) ) => {
0 commit comments