mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-30 23:02:15 +00:00
Fix bug that could cause huge slowdowns during initial header sync: peers were not checking if they were still download peers after receiving header messages.
This commit is contained in:
parent
a700b97f75
commit
e14e7a228c
@ -364,6 +364,11 @@ public class Peer {
|
||||
for (int i = 0; i < m.getBlockHeaders().size(); i++) {
|
||||
Block header = m.getBlockHeaders().get(i);
|
||||
if (header.getTimeSeconds() < fastCatchupTimeSecs) {
|
||||
if (!downloadData.get()) {
|
||||
// Not download peer anymore, some other peer probably became better.
|
||||
log.info("Lost download peer status, throwing away downloaded headers.");
|
||||
return;
|
||||
}
|
||||
if (blockChain.add(header)) {
|
||||
// The block was successfully linked into the chain. Notify the user of our progress.
|
||||
invokeOnBlocksDownloaded(header);
|
||||
|
Loading…
Reference in New Issue
Block a user