diff options
author | bojie <bojie@dexon.org> | 2019-01-16 17:08:56 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 13:50:01 +0800 |
commit | a1fcc8c0a89f3318ca929f09a1ad07360a86bdf1 (patch) | |
tree | bb89b7dac7bc6a96852bcc0c565c8dcc6cdc0c0f /core | |
parent | 1791922f4cb45fd4eaf8ed7df7ae3967d7050160 (diff) | |
download | dexon-a1fcc8c0a89f3318ca929f09a1ad07360a86bdf1.tar dexon-a1fcc8c0a89f3318ca929f09a1ad07360a86bdf1.tar.gz dexon-a1fcc8c0a89f3318ca929f09a1ad07360a86bdf1.tar.bz2 dexon-a1fcc8c0a89f3318ca929f09a1ad07360a86bdf1.tar.lz dexon-a1fcc8c0a89f3318ca929f09a1ad07360a86bdf1.tar.xz dexon-a1fcc8c0a89f3318ca929f09a1ad07360a86bdf1.tar.zst dexon-a1fcc8c0a89f3318ca929f09a1ad07360a86bdf1.zip |
app: fix reward bug with empty block (#155)
* app: fix reward bug with empty block
* make block generation consistent
* revert change to dmoment in genesis.json
Diffstat (limited to 'core')
-rw-r--r-- | core/blockchain.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index 6aee356d2..e6d7cdc76 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1959,13 +1959,12 @@ func (bc *BlockChain) ProcessEmptyBlock(block *types.Block) (*common.Hash, error } header.ParentHash = parentBlock.Hash() - header.GasUsed = 0 - header.Root = currentState.IntermediateRoot(true) + newBlock, err := bc.engine.Finalize(bc, header, currentState, nil, nil, nil) + if header.Root != parentBlock.Root() { return nil, fmt.Errorf("empty block state root must same as parent") } - newBlock := types.NewBlock(header, nil, nil, nil) root := newBlock.Root() if _, ok := bc.GetRoundHeight(newBlock.Round()); !ok { bc.storeRoundHeight(newBlock.Round(), newBlock.NumberU64()) |