mirror of
https://github.com/btcsuite/btcd.git
synced 2025-02-22 14:22:49 +01:00
blockchain: set the lastflushtime when setting the lastflushhash
On startup when the headers-first mode is off, when receiving the first block, the periodic flush will trigger. The lastflushtime wasn't set which resulted in the flush being triggered on the first block on restart.
This commit is contained in:
parent
b1b9420208
commit
e307ad122f
1 changed files with 4 additions and 0 deletions
|
@ -634,6 +634,10 @@ func (b *BlockChain) InitConsistentState(tip *blockNode, interrupt <-chan struct
|
|||
// it to the tip since we checked it's consistent.
|
||||
s.lastFlushHash = tip.hash
|
||||
|
||||
// Set the last flush time as now since we know the state is consistent
|
||||
// at this time.
|
||||
s.lastFlushTime = time.Now()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue