Don't stall sync when header chain regresses (#1644)

This should normally never happen but this is meant to catch unforeseen edge cases or block acceptance bugs.
This commit is contained in:
Ignotus Peverell
2018-10-03 09:07:57 -07:00
committed by GitHub
parent 497d66e482
commit 2919a78b0f
+1 -1
View File
@@ -743,7 +743,7 @@ impl SyncInfo {
let all_headers_received =
header_head.height >= prev_height + (p2p::MAX_BLOCK_HEADERS as u64) - 4;
// no headers processed and we're past timeout, need to ask for more
let stalling = header_head.height == latest_height && now > timeout;
let stalling = header_head.height <= latest_height && now > timeout;
// always enable header sync on initial state transition from NoSync / Initial
let force_sync = match sync_state.status() {