Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spv: Fix request of new blocks after initial sync
This fixes an issue where SPV wallets would only request blocks from peers after a new block was mined. The issue could be triggered if the number of peers ever dropped to zero, causing the SPV syncer to consider itself unsynced, and if blocks were mined in the intervening period until a new peer was connected. The root cause was the addition of the unsynced status on the refactoring made in commit 6cde2cc. That made the sync status atomic decoupled to the state of the initialSyncDone signalling channel, which meant that if the atomic was switched to zero after the initial sync was done, new headers would fail to be requested from newly connected peers. Upon further review, the check is ultimately unnecessary and is removed in this commit ensuring that, after initial sync is completed, the headers are asked of every peer.
- Loading branch information