From a75c0610b7aad63de01cefeeaf3426b332e718eb Mon Sep 17 00:00:00 2001
From: meowsbits <45600330+meowsbits@users.noreply.github.com>
Date: Mon, 23 Mar 2020 09:05:15 -0500
Subject: [PATCH] core/blockchain: simplify atomic store after
 writeBlockWithState (#20798)

Signed-off-by: meows <b5c6@protonmail.com>
---
 core/blockchain.go | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/core/blockchain.go b/core/blockchain.go
index de0d4f399..1da899ab4 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -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
-- 
GitLab