@@ -1730,24 +1730,27 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
1730
1730
return Err ( PeerHandleError { } . into ( ) ) ;
1731
1731
}
1732
1732
1733
- if let wire:: Message :: GossipTimestampFilter ( msg ) = message {
1733
+ if let wire:: Message :: GossipTimestampFilter ( _msg ) = message {
1734
1734
// When supporting gossip messages, start initial gossip sync only after we receive
1735
1735
// a GossipTimestampFilter
1736
1736
1737
1737
if peer_lock. their_features . as_ref ( ) . unwrap ( ) . supports_gossip_queries ( ) &&
1738
1738
!peer_lock. sent_gossip_timestamp_filter {
1739
1739
peer_lock. sent_gossip_timestamp_filter = true ;
1740
1740
1741
- #[ allow( unused_mut, unused_assignments ) ]
1742
- let mut full_sync_threshold = 0 ;
1741
+ #[ allow( unused_mut) ]
1742
+ let mut should_do_full_sync = true ;
1743
1743
#[ cfg( feature = "std" ) ]
1744
1744
{
1745
1745
// if the timestamp range starts more than six hours ago, do a full sync
1746
- // otherwise, start at the current time
1746
+ // otherwise, only forward ad-hoc gossip
1747
1747
use std:: time:: { SystemTime , UNIX_EPOCH } ;
1748
- full_sync_threshold = SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) . expect ( "Time must be > 1970" ) . as_secs ( ) - 6 * 3600 ;
1748
+ let full_sync_threshold = SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) . expect ( "Time must be > 1970" ) . as_secs ( ) - 6 * 3600 ;
1749
+ if ( _msg. first_timestamp as u64 ) > full_sync_threshold {
1750
+ should_do_full_sync = false ;
1751
+ }
1749
1752
}
1750
- if ( msg . first_timestamp as u64 ) <= full_sync_threshold {
1753
+ if should_do_full_sync {
1751
1754
peer_lock. sync_status = InitSyncTracker :: ChannelsSyncing ( 0 ) ;
1752
1755
}
1753
1756
}
0 commit comments