Skip to content

Commit 01ddd5e

Browse files
committed
Explicitly specify default sync behavior for no-std
1 parent 90c6bbc commit 01ddd5e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lightning/src/ln/peer_handler.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,15 +1739,18 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
17391739
peer_lock.sent_gossip_timestamp_filter = true;
17401740

17411741
#[allow(unused_mut, unused_assignments)]
1742-
let mut full_sync_threshold = 0;
1742+
let mut should_do_full_sync = true;
17431743
#[cfg(feature = "std")]
17441744
{
17451745
// if the timestamp range starts more than six hours ago, do a full sync
17461746
// otherwise, start at the current time
17471747
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+
}
17491752
}
1750-
if (msg.first_timestamp as u64) <= full_sync_threshold {
1753+
if should_do_full_sync {
17511754
peer_lock.sync_status = InitSyncTracker::ChannelsSyncing(0);
17521755
}
17531756
}

0 commit comments

Comments
 (0)