aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain.go
diff options
context:
space:
mode:
authorbojie <bojie@dexon.org>2019-03-11 17:43:52 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 13:50:03 +0800
commitdccc432e425c51035a901373d9f6a4452ac4c6ba (patch)
treebacc4846e61f3ffd4f0a80a729590789337e7730 /core/blockchain.go
parent5699504363e928a7c2d84363014d7174b49bad2a (diff)
downloaddexon-dccc432e425c51035a901373d9f6a4452ac4c6ba.tar.gz
dexon-dccc432e425c51035a901373d9f6a4452ac4c6ba.tar.zst
dexon-dccc432e425c51035a901373d9f6a4452ac4c6ba.zip
app: new app test flow (#244)
Diffstat (limited to 'core/blockchain.go')
-rw-r--r--core/blockchain.go40
1 files changed, 0 insertions, 40 deletions
diff --git a/core/blockchain.go b/core/blockchain.go
index aa2326c8d..f829c0e8e 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -931,13 +931,6 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [
bytes += batch.ValueSize()
batch.Reset()
}
-
- if i == len(blockChain)-1 {
- err := bc.updateLastRoundNumber(block.Round())
- if err != nil {
- return 0, err
- }
- }
}
if batch.ValueSize() > 0 {
bytes += batch.ValueSize()
@@ -1664,13 +1657,6 @@ func (bc *BlockChain) insertDexonChain(chain types.Blocks) (int, []interface{},
cache, _ := bc.stateCache.TrieDB().Size()
stats.report(chain, i, cache)
-
- if i == len(chain)-1 {
- err = bc.updateLastRoundNumber(block.Round())
- if err != nil {
- return 0, nil, nil, err
- }
- }
}
// Append a single chain head event if we've progressed the chain
if lastCanon != nil && bc.CurrentBlock().Hash() == lastCanon.Hash() {
@@ -1807,11 +1793,6 @@ func (bc *BlockChain) processBlock(
cache, _ := bc.stateCache.TrieDB().Size()
stats.report([]*types.Block{newBlock}, 0, cache)
- err = bc.updateLastRoundNumber(newBlock.Round())
- if err != nil {
- return nil, nil, nil, err
- }
-
return &root, events, coalescedLogs, nil
}
@@ -1894,11 +1875,6 @@ func (bc *BlockChain) ProcessEmptyBlock(block *types.Block) (*common.Hash, error
cache, _ := bc.stateCache.TrieDB().Size()
stats.report([]*types.Block{newBlock}, 0, cache)
- err = bc.updateLastRoundNumber(newBlock.Round())
- if err != nil {
- return nil, err
- }
-
bc.PostChainEvents([]interface{}{ChainEvent{newBlock, newBlock.Hash(), nil},
ChainHeadEvent{newBlock}}, nil)
@@ -2327,19 +2303,3 @@ func (bc *BlockChain) GetRoundHeight(round uint64) (uint64, bool) {
func (bc *BlockChain) storeRoundHeight(round uint64, height uint64) {
bc.roundHeightMap.Store(round, height)
}
-
-func (bc *BlockChain) updateLastRoundNumber(round uint64) error {
- currentLastRound, err := rawdb.ReadLastRoundNumber(bc.db)
- if err != nil {
- return err
- }
-
- if round > currentLastRound {
- err = rawdb.WriteLastRoundNumber(bc.db, round)
- if err != nil {
- return err
- }
- }
-
- return nil
-}