Don't stall sync when header chain regresses ()

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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() {