Skip to content

Commit

Permalink
blockchain: set the lastflushtime when setting the lastflushhash
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kcalvinalvin committed Jan 3, 2024
1 parent b1b9420 commit e307ad1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions blockchain/utxocache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit e307ad1

Please sign in to comment.