btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.1k stars 2.31k forks source link

wire, netsync: change isSyncCandidate behavior #2035

Closed kcalvinalvin closed 7 months ago

kcalvinalvin commented 9 months ago

isSyncCandidate is now changed to return true even if the peer is a pruned node if and only if our chaintip is within 288 blocks of the peer.

Rationale being that pruned nodes that signal NODE_NETWORK_LIMITED MUST serve 288 blocks from their chaintip. If our chaintip is within that range, this peer can be a sync candidate even if they aren't an archival node.

Roasbeef commented 9 months ago

cc @ellemouton

coveralls commented 8 months ago

Pull Request Test Coverage Report for Build 6779126378


Changes Missing Coverage Covered Lines Changed/Added Lines %
netsync/manager.go 0 37 0.0%
<!-- Total: 3 40 7.5% -->
Files with Coverage Reduction New Missed Lines %
mempool/mempool.go 1 66.75%
peer/peer.go 6 74.16%
<!-- Total: 7 -->
Totals Coverage Status
Change from base Build 6776433285: -0.02%
Covered Lines: 27150
Relevant Lines: 48753

💛 - Coveralls