-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spv: Add watchdog timer to cfilter fetching
This commits adds a watchdog timer to the initial cfilter fetching, triggered when a batch takes too long to be successfully fetched. In some situations, specially close to the tip, the sidechain forest may be populated with one (or more) headers for which no cfilter is available in the network. In this situation, the syncer could end up in a state where it does not advance due to waiting for cfilters that will never be sent by any peers. To alleviate this issue, a watchdog timer is started for every batch of cfilters. If that timer is triggered, then the entire sidechain forest is pruned, ensuring the next batch of headers that will be fetched will be using fresh block locators and that the best chain selected for fetching cfilters will be for these fresh headers. The timer interval is set for 2 minutes, which given the stall timer of 30 seconds per peer means at least 4 peers will be searched for the cfilters, before giving up and resetting the forest.
- Loading branch information
Showing
2 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters