@@ -250,7 +250,7 @@ where C::Target: chain::Access, L::Target: Logger
250
250
251
251
impl < L : Deref > EventHandler for NetworkGraph < L > where L :: Target : Logger {
252
252
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 {
254
254
if let Some ( network_update) = network_update {
255
255
match * network_update {
256
256
NetworkUpdate :: ChannelUpdateMessage { ref msg } => {
@@ -1632,7 +1632,6 @@ mod tests {
1632
1632
UnsignedChannelAnnouncement , ChannelAnnouncement , UnsignedChannelUpdate , ChannelUpdate ,
1633
1633
ReplyChannelRange , QueryChannelRange , QueryShortChannelIds , MAX_VALUE_MSAT } ;
1634
1634
use util:: test_utils;
1635
- use util:: logger:: Logger ;
1636
1635
use util:: ser:: { ReadableArgs , Writeable } ;
1637
1636
use util:: events:: { Event , EventHandler , MessageSendEvent , MessageSendEventsProvider } ;
1638
1637
use util:: scid_utils:: scid_from_parts;
@@ -1829,7 +1828,7 @@ mod tests {
1829
1828
#[ test]
1830
1829
fn handling_channel_announcements ( ) {
1831
1830
let secp_ctx = Secp256k1 :: new ( ) ;
1832
- let logger: Arc < Logger > = Arc :: new ( test_utils:: TestLogger :: new ( ) ) ;
1831
+ let logger = test_utils:: TestLogger :: new ( ) ;
1833
1832
1834
1833
let node_1_privkey = & SecretKey :: from_slice ( & [ 42 ; 32 ] ) . unwrap ( ) ;
1835
1834
let node_2_privkey = & SecretKey :: from_slice ( & [ 41 ; 32 ] ) . unwrap ( ) ;
@@ -1839,8 +1838,8 @@ mod tests {
1839
1838
1840
1839
// Test if the UTXO lookups were not supported
1841
1840
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) ;
1844
1843
match gossip_sync. handle_channel_announcement ( & valid_announcement) {
1845
1844
Ok ( res) => assert ! ( res) ,
1846
1845
_ => panic ! ( )
@@ -1861,10 +1860,10 @@ mod tests {
1861
1860
} ;
1862
1861
1863
1862
// 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 ) ;
1865
1864
* 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) ;
1868
1867
1869
1868
let valid_announcement = get_signed_channel_announcement ( |unsigned_announcement| {
1870
1869
unsigned_announcement. short_channel_id += 1 ;
@@ -1945,11 +1944,11 @@ mod tests {
1945
1944
#[ test]
1946
1945
fn handling_channel_update ( ) {
1947
1946
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 ) ;
1950
1949
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) ;
1953
1952
1954
1953
let node_1_privkey = & SecretKey :: from_slice ( & [ 42 ; 32 ] ) . unwrap ( ) ;
1955
1954
let node_2_privkey = & SecretKey :: from_slice ( & [ 41 ; 32 ] ) . unwrap ( ) ;
@@ -2151,10 +2150,10 @@ mod tests {
2151
2150
fn test_channel_timeouts ( ) {
2152
2151
// Test the removal of channels with `remove_stale_channels`.
2153
2152
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 ) ;
2155
2154
let genesis_hash = genesis_block ( Network :: Testnet ) . header . block_hash ( ) ;
2156
2155
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) ;
2158
2157
let secp_ctx = Secp256k1 :: new ( ) ;
2159
2158
2160
2159
let node_1_privkey = & SecretKey :: from_slice ( & [ 42 ; 32 ] ) . unwrap ( ) ;
0 commit comments