core: simplify atomic store after writeBlockWithState

Signed-off-by: meows <b5c6@protonmail.com>
This commit is contained in:
meows 2020-03-21 08:03:45 -05:00
parent 613af7ceea
commit 814c2ede74
No known key found for this signature in database
GPG key ID: 5786AEA5C8D5A520

View file

@ -1740,11 +1740,10 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
// Write the block to the chain and get the status.
substart = time.Now()
status, err := bc.writeBlockWithState(block, receipts, logs, statedb, false)
atomic.StoreUint32(&followupInterrupt, 1)
if err != nil {
atomic.StoreUint32(&followupInterrupt, 1)
return it.index, err
}
atomic.StoreUint32(&followupInterrupt, 1)
// Update the metrics touched during block commit
accountCommitTimer.Update(statedb.AccountCommits) // Account commits are complete, we can mark them