diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-01-17 17:00:46 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-01-17 17:01:24 +0800 |
commit | 78dfa1fcac7125048a20f35060497b7eb03fb0b7 (patch) | |
tree | aa01a3f4f849233ebd5c8a8856ce3200b6b89bf6 /core | |
parent | cd491a6cb58c8f138d449b24bfecab0e37fa598f (diff) | |
download | dexon-78dfa1fcac7125048a20f35060497b7eb03fb0b7.tar dexon-78dfa1fcac7125048a20f35060497b7eb03fb0b7.tar.gz dexon-78dfa1fcac7125048a20f35060497b7eb03fb0b7.tar.bz2 dexon-78dfa1fcac7125048a20f35060497b7eb03fb0b7.tar.lz dexon-78dfa1fcac7125048a20f35060497b7eb03fb0b7.tar.xz dexon-78dfa1fcac7125048a20f35060497b7eb03fb0b7.tar.zst dexon-78dfa1fcac7125048a20f35060497b7eb03fb0b7.zip |
Revert "core: do not panic on fork (#146)"
This reverts commit bdde6109ffa6fa4d295708a2a75271186a12c761.
Diffstat (limited to 'core')
-rw-r--r-- | core/blockchain.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index 1a3708ef2..99d79519e 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1778,7 +1778,7 @@ func (bc *BlockChain) insertDexonChain(chain types.Blocks) (int, []interface{}, blockInsertTimer.UpdateSince(bstart) events = append(events, ChainSideEvent{block}) - return 0, nil, nil, errors.New("fork round") + panic("fork found") } stats.processed++ stats.usedGas += usedGas @@ -1917,10 +1917,7 @@ func (bc *BlockChain) processBlock( bc.gcproc += proctime case SideStatTy: - log.Debug("Inserted forked block", "number", block.Number(), "hash", block.Hash(), "diff", block.Difficulty(), "elapsed", - common.PrettyDuration(time.Since(bstart)), "txs", len(block.Transactions()), "gas", block.GasUsed(), "uncles", len(block.Uncles())) - - return nil, nil, nil, errors.New("fork round") + return nil, nil, nil, fmt.Errorf("insert pending block and fork found") } stats.processed++ @@ -1998,9 +1995,7 @@ func (bc *BlockChain) ProcessEmptyBlock(block *types.Block) (*common.Hash, error bc.gcproc += proctime case SideStatTy: - log.Debug("Inserted forked block", "number", block.Number(), "hash", block.Hash(), "diff", block.Difficulty(), "elapsed", - common.PrettyDuration(time.Since(bstart)), "txs", len(block.Transactions()), "gas", block.GasUsed(), "uncles", len(block.Uncles())) - return nil, fmt.Errorf("fork found") + return nil, fmt.Errorf("insert pending block and fork found") } stats.processed++ @@ -2288,6 +2283,7 @@ func (bc *BlockChain) InsertDexonHeaderChain(chain []*types.HeaderWithGovState, if status == SideStatTy { log.Debug("Inserted forked block header", "number", header.Number, "hash", header.Hash, "diff", header.Difficulty, "gas", header.GasUsed) + panic("fork found") } return err } |