We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d1cd66 commit b3e7b8bCopy full SHA for b3e7b8b
core/blockchain.go
@@ -1555,6 +1555,11 @@ func (bc *BlockChain) writeKnownBlock(block *types.Block) error {
1555
return nil
1556
}
1557
1558
+func (bc *BlockChain) TimeBeforeFlush() time.Duration {
1559
+ flushInterval := time.Duration(bc.flushInterval.Load())
1560
+ return flushInterval - (bc.gcproc + bc.gcprocRandOffset)
1561
+}
1562
+
1563
// writeBlockWithState writes block, metadata and corresponding state data to the
1564
// database.
1565
func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.Receipt, statedb *state.StateDB) error {
0 commit comments