From 95ae4c9b65db88021c40f1aa90541001cfad5cda Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 17 Sep 2020 13:31:23 -0400 Subject: disable reorg entirely --- core/blockchain.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/blockchain.go b/core/blockchain.go index 82e3b6c..208a026 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1420,7 +1420,7 @@ func (bc *BlockChain) writeKnownBlock(block *types.Block) error { defer bc.wg.Done() current := bc.CurrentBlock() - if block.ParentHash() != current.Hash() { + if !bc.manualCanonical && block.ParentHash() != current.Hash() { if err := bc.reorg(current, block); err != nil { return err } @@ -2051,6 +2051,7 @@ func (bc *BlockChain) insertSideChain(block *types.Block, it *insertIterator) (i // blocks and inserts them to be part of the new canonical chain and accumulates // potential missing transactions and post an event about them. func (bc *BlockChain) reorg(oldBlock, newBlock *types.Block) error { + log.Error("reorg shouldn't happen!!!") var ( newChain types.Blocks oldChain types.Blocks -- cgit v1.2.3