mirror of
https://github.com/btcsuite/btcd.git
synced 2026-08-13 12:32:51 +02:00
TestSyncStateMachine checked that handleHeadersMsg advanced lastProgressTime by comparing it against the timestamp written by startSync. Those two writes can happen within the same clock tick, so the handler can update the field while time.After still reports false. Reset lastProgressTime to the zero value before delivering headers and assert that the handler writes a non-zero value. This keeps the test focused on the behavior under test without depending on adjacent time.Now calls producing distinct timestamps. |
||
|---|---|---|
| .. | ||
| testdata | ||
| blocklogger.go | ||
| doc.go | ||
| interface.go | ||
| log.go | ||
| manager.go | ||
| manager_test.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.