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@byzantine-lab.io>2019-06-12 17:27:22 +0800
commit8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461 (patch)
tree3c54d34e573b97ed4120a33bc5d6593e618a9d49 /core/blockchain.go
parent04cb64b849988c1cf71fd66a3142f01e8ba7cb23 (diff)
downloadgo-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar.gz
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar.bz2
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar.lz
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar.xz
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.tar.zst
go-tangerine-8ffc8f2b78bfb3cc352f71ca569ad6c09bda1461.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
-}