a9f23321d9
This commit modifies the sync peer selection to prefer peers with a higher advertised height than our currently known best height. If no peers are known with a higher height, we will fall back to selecting a random peer with the same best height as our own. The current algorithm currently selects a random peer from the union of these two sets, while this approach will favor trying to make progress. This will likely help in selecting a good peer once already at tip, such as after a restart. Backport of https://github.com/gcash/bchd/pull/96 |
||
---|---|---|
.. | ||
blocklogger.go | ||
doc.go | ||
interface.go | ||
log.go | ||
manager.go | ||
README.md |
netsync
Overview
This package implements a concurrency safe block syncing protocol. The SyncManager communicates with connected peers to perform an initial block download, keep the chain and unconfirmed transaction pool in sync, and announce new blocks connected to the chain. Currently the sync manager selects a single sync peer that it downloads all blocks from until it is up to date with the longest chain the sync peer is aware of.
Installation and Updating
$ go get -u github.com/btcsuite/btcd/netsync
License
Package netsync is licensed under the copyfree ISC License.