mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 18:00:11 +01:00
Fix regtest mode with new headers-first approach.
The regression test does not work properly with the new headers-first download approach, so force the old inv-based block download for regression test mode.
This commit is contained in:
parent
7b406dcb0f
commit
011025dc0d
@ -152,11 +152,12 @@ func (b *blockManager) startSync(peers *list.List) {
|
||||
bmgrLog.Infof("Syncing to block height %d from peer %v",
|
||||
bestPeer.lastBlock, bestPeer.addr)
|
||||
|
||||
// if starting from the beginning fetch headers and
|
||||
// download blocks based on that, otherwise compute
|
||||
// the block download via inv messages.
|
||||
|
||||
if height == 0 {
|
||||
// if starting from the beginning fetch headers and download
|
||||
// blocks based on that, otherwise compute the block download
|
||||
// via inv messages. Regression test mode does not support the
|
||||
// headers-first approach so do normal block downloads when in
|
||||
// regression test mode.
|
||||
if height == 0 && !cfg.RegressionTest {
|
||||
bestPeer.PushGetHeadersMsg(locator)
|
||||
b.fetchingHeaders = true
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user