From 1d23f35b9967af5626cad02e4e6f4f4ff48a84bb Mon Sep 17 00:00:00 2001 From: "amalraj.manigmail.com" Date: Fri, 8 May 2020 16:51:09 +0800 Subject: [PATCH] raft: return error if block processing is aborted --- core/blockchain.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/blockchain.go b/core/blockchain.go index 86f8e6371..1ced407cf 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1557,6 +1557,12 @@ func mergeReceipts(pub, priv types.Receipts) types.Receipts { func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, []interface{}, []*types.Log, error) { // If the chain is terminating, don't even bother starting up if atomic.LoadInt32(&bc.procInterrupt) == 1 { + log.Debug("Premature abort during blocks processing") + // QUORUM + if bc.isRaft() { + // Only returns an error for raft mode + return 0, nil, nil, ErrAbortBlocksProcessing + } return 0, nil, nil, nil } // Start a parallel signature recovery (signer will fluke on fork transition, minimal perf loss)