@@ -843,7 +843,7 @@ impl<G: Deref<Target = NetworkGraph<L>>, U: UtxoLookup, L: Logger> BaseMessageHa
843843 let mut gossip_start_time = 0 ;
844844 #[ allow( unused) ]
845845 let should_sync = self . should_request_full_sync ( ) ;
846- #[ cfg( feature = "std" ) ]
846+ #[ cfg( all ( feature = "std" , not ( fuzzing ) ) ) ]
847847 {
848848 gossip_start_time = SystemTime :: now ( )
849849 . duration_since ( UNIX_EPOCH )
@@ -2195,7 +2195,7 @@ impl<L: Logger> NetworkGraph<L> {
21952195
21962196 #[ allow( unused_mut, unused_assignments) ]
21972197 let mut announcement_received_time = 0 ;
2198- #[ cfg( feature = "std" ) ]
2198+ #[ cfg( all ( feature = "std" , not ( fuzzing ) ) ) ]
21992199 {
22002200 announcement_received_time = SystemTime :: now ( )
22012201 . duration_since ( UNIX_EPOCH )
@@ -2235,11 +2235,11 @@ impl<L: Logger> NetworkGraph<L> {
22352235 ///
22362236 /// The channel and any node for which this was their last channel are removed from the graph.
22372237 pub fn channel_failed_permanent ( & self , short_channel_id : u64 ) {
2238- #[ cfg( feature = "std" ) ]
2238+ #[ cfg( all ( feature = "std" , not ( fuzzing ) ) ) ]
22392239 let current_time_unix = Some (
22402240 SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) . expect ( "Time must be > 1970" ) . as_secs ( ) ,
22412241 ) ;
2242- #[ cfg( not( feature = "std" ) ) ]
2242+ #[ cfg( any ( not( feature = "std" ) , fuzzing ) ) ]
22432243 let current_time_unix = None ;
22442244
22452245 self . channel_failed_permanent_with_time ( short_channel_id, current_time_unix)
@@ -2262,11 +2262,11 @@ impl<L: Logger> NetworkGraph<L> {
22622262 /// Marks a node in the graph as permanently failed, effectively removing it and its channels
22632263 /// from local storage.
22642264 pub fn node_failed_permanent ( & self , node_id : & PublicKey ) {
2265- #[ cfg( feature = "std" ) ]
2265+ #[ cfg( all ( feature = "std" , not ( fuzzing ) ) ) ]
22662266 let current_time_unix = Some (
22672267 SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) . expect ( "Time must be > 1970" ) . as_secs ( ) ,
22682268 ) ;
2269- #[ cfg( not( feature = "std" ) ) ]
2269+ #[ cfg( any ( not( feature = "std" ) , fuzzing ) ) ]
22702270 let current_time_unix = None ;
22712271
22722272 let node_id = NodeId :: from_pubkey ( node_id) ;
@@ -2303,7 +2303,6 @@ impl<L: Logger> NetworkGraph<L> {
23032303 }
23042304 }
23052305
2306- #[ cfg( feature = "std" ) ]
23072306 /// Removes information about channels that we haven't heard any updates about in some time.
23082307 /// This can be used regularly to prune the network graph of channels that likely no longer
23092308 /// exist.
@@ -2318,8 +2317,9 @@ impl<L: Logger> NetworkGraph<L> {
23182317 /// This method will also cause us to stop tracking removed nodes and channels if they have been
23192318 /// in the map for a while so that these can be resynced from gossip in the future.
23202319 ///
2321- /// This method is only available with the `std` feature. See
2320+ /// This method is only available with the `std` feature (and not during fuzzing) . See
23222321 /// [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for non-`std` use.
2322+ #[ cfg( all( feature = "std" , not( fuzzing) ) ) ]
23232323 pub fn remove_stale_channels_and_tracking ( & self ) {
23242324 let time =
23252325 SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) . expect ( "Time must be > 1970" ) . as_secs ( ) ;
@@ -2476,7 +2476,7 @@ impl<L: Logger> NetworkGraph<L> {
24762476 } ) ;
24772477 }
24782478
2479- #[ cfg( all( feature = "std" , not( test) , not( feature = "_test_utils" ) ) ) ]
2479+ #[ cfg( all( feature = "std" , not( test) , not( feature = "_test_utils" ) , not ( fuzzing ) ) ) ]
24802480 {
24812481 // Note that many tests rely on being able to set arbitrarily old timestamps, thus we
24822482 // disable this check during tests!
0 commit comments