@@ -250,7 +250,7 @@ where C::Target: chain::Access, L::Target: Logger
250250
251251impl < L : Deref > EventHandler for NetworkGraph < L > where L :: Target : Logger {
252252 fn handle_event ( & self , event : & Event ) {
253- if let Event :: PaymentPathFailed { payment_hash : _ , rejected_by_dest : _ , network_update, .. } = event {
253+ if let Event :: PaymentPathFailed { network_update, .. } = event {
254254 if let Some ( network_update) = network_update {
255255 match * network_update {
256256 NetworkUpdate :: ChannelUpdateMessage { ref msg } => {
@@ -1632,7 +1632,6 @@ mod tests {
16321632 UnsignedChannelAnnouncement , ChannelAnnouncement , UnsignedChannelUpdate , ChannelUpdate ,
16331633 ReplyChannelRange , QueryChannelRange , QueryShortChannelIds , MAX_VALUE_MSAT } ;
16341634 use util:: test_utils;
1635- use util:: logger:: Logger ;
16361635 use util:: ser:: { ReadableArgs , Writeable } ;
16371636 use util:: events:: { Event , EventHandler , MessageSendEvent , MessageSendEventsProvider } ;
16381637 use util:: scid_utils:: scid_from_parts;
@@ -1829,7 +1828,7 @@ mod tests {
18291828 #[ test]
18301829 fn handling_channel_announcements ( ) {
18311830 let secp_ctx = Secp256k1 :: new ( ) ;
1832- let logger: Arc < Logger > = Arc :: new ( test_utils:: TestLogger :: new ( ) ) ;
1831+ let logger = test_utils:: TestLogger :: new ( ) ;
18331832
18341833 let node_1_privkey = & SecretKey :: from_slice ( & [ 42 ; 32 ] ) . unwrap ( ) ;
18351834 let node_2_privkey = & SecretKey :: from_slice ( & [ 41 ; 32 ] ) . unwrap ( ) ;
@@ -1839,8 +1838,8 @@ mod tests {
18391838
18401839 // Test if the UTXO lookups were not supported
18411840 let genesis_hash = genesis_block ( Network :: Testnet ) . header . block_hash ( ) ;
1842- let network_graph = NetworkGraph :: new ( genesis_hash, Arc :: clone ( & logger) ) ;
1843- let mut gossip_sync = P2PGossipSync :: new ( & network_graph, None , Arc :: clone ( & logger) ) ;
1841+ let network_graph = NetworkGraph :: new ( genesis_hash, & logger) ;
1842+ let mut gossip_sync = P2PGossipSync :: new ( & network_graph, None , & logger) ;
18441843 match gossip_sync. handle_channel_announcement ( & valid_announcement) {
18451844 Ok ( res) => assert ! ( res) ,
18461845 _ => panic ! ( )
@@ -1861,10 +1860,10 @@ mod tests {
18611860 } ;
18621861
18631862 // Test if an associated transaction were not on-chain (or not confirmed).
1864- let chain_source = Arc :: new ( test_utils:: TestChainSource :: new ( Network :: Testnet ) ) ;
1863+ let chain_source = test_utils:: TestChainSource :: new ( Network :: Testnet ) ;
18651864 * chain_source. utxo_ret . lock ( ) . unwrap ( ) = Err ( chain:: AccessError :: UnknownTx ) ;
1866- let network_graph = NetworkGraph :: new ( genesis_hash, Arc :: clone ( & logger) ) ;
1867- gossip_sync = P2PGossipSync :: new ( & network_graph, Some ( chain_source. clone ( ) ) , Arc :: clone ( & logger) ) ;
1865+ let network_graph = NetworkGraph :: new ( genesis_hash, & logger) ;
1866+ gossip_sync = P2PGossipSync :: new ( & network_graph, Some ( & chain_source) , & logger) ;
18681867
18691868 let valid_announcement = get_signed_channel_announcement ( |unsigned_announcement| {
18701869 unsigned_announcement. short_channel_id += 1 ;
@@ -1945,11 +1944,11 @@ mod tests {
19451944 #[ test]
19461945 fn handling_channel_update ( ) {
19471946 let secp_ctx = Secp256k1 :: new ( ) ;
1948- let logger: Arc < Logger > = Arc :: new ( test_utils:: TestLogger :: new ( ) ) ;
1949- let chain_source = Arc :: new ( test_utils:: TestChainSource :: new ( Network :: Testnet ) ) ;
1947+ let logger = test_utils:: TestLogger :: new ( ) ;
1948+ let chain_source = test_utils:: TestChainSource :: new ( Network :: Testnet ) ;
19501949 let genesis_hash = genesis_block ( Network :: Testnet ) . header . block_hash ( ) ;
1951- let network_graph = NetworkGraph :: new ( genesis_hash, Arc :: clone ( & logger) ) ;
1952- let gossip_sync = P2PGossipSync :: new ( & network_graph, Some ( chain_source. clone ( ) ) , Arc :: clone ( & logger) ) ;
1950+ let network_graph = NetworkGraph :: new ( genesis_hash, & logger) ;
1951+ let gossip_sync = P2PGossipSync :: new ( & network_graph, Some ( & chain_source) , & logger) ;
19531952
19541953 let node_1_privkey = & SecretKey :: from_slice ( & [ 42 ; 32 ] ) . unwrap ( ) ;
19551954 let node_2_privkey = & SecretKey :: from_slice ( & [ 41 ; 32 ] ) . unwrap ( ) ;
@@ -2151,10 +2150,10 @@ mod tests {
21512150 fn test_channel_timeouts ( ) {
21522151 // Test the removal of channels with `remove_stale_channels`.
21532152 let logger = test_utils:: TestLogger :: new ( ) ;
2154- let chain_source = Arc :: new ( test_utils:: TestChainSource :: new ( Network :: Testnet ) ) ;
2153+ let chain_source = test_utils:: TestChainSource :: new ( Network :: Testnet ) ;
21552154 let genesis_hash = genesis_block ( Network :: Testnet ) . header . block_hash ( ) ;
21562155 let network_graph = NetworkGraph :: new ( genesis_hash, & logger) ;
2157- let gossip_sync = P2PGossipSync :: new ( & network_graph, Some ( chain_source. clone ( ) ) , & logger) ;
2156+ let gossip_sync = P2PGossipSync :: new ( & network_graph, Some ( & chain_source) , & logger) ;
21582157 let secp_ctx = Secp256k1 :: new ( ) ;
21592158
21602159 let node_1_privkey = & SecretKey :: from_slice ( & [ 42 ; 32 ] ) . unwrap ( ) ;
0 commit comments