aboutsummaryrefslogtreecommitdiffstats
path: root/consensus
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-03-27 13:17:22 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:58 +0800
commit4e0fc985b66e584177572481dfe9e21858a7711c (patch)
tree8181f47271e60a324e3753d8c2cab64366c48479 /consensus
parent78b707cebf4b3bc101e0793f14f9cac7323bff04 (diff)
downloaddexon-4e0fc985b66e584177572481dfe9e21858a7711c.tar
dexon-4e0fc985b66e584177572481dfe9e21858a7711c.tar.gz
dexon-4e0fc985b66e584177572481dfe9e21858a7711c.tar.bz2
dexon-4e0fc985b66e584177572481dfe9e21858a7711c.tar.lz
dexon-4e0fc985b66e584177572481dfe9e21858a7711c.tar.xz
dexon-4e0fc985b66e584177572481dfe9e21858a7711c.tar.zst
dexon-4e0fc985b66e584177572481dfe9e21858a7711c.zip
core: fix finalize logic (#302)
Diffstat (limited to 'consensus')
-rw-r--r--consensus/dexcon/dexcon.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/consensus/dexcon/dexcon.go b/consensus/dexcon/dexcon.go
index 0b6fa192f..4e474bfa3 100644
--- a/consensus/dexcon/dexcon.go
+++ b/consensus/dexcon/dexcon.go
@@ -208,8 +208,10 @@ func (d *Dexcon) Finalize(chain consensus.ChainReader, header *types.Header, sta
gs.MiningHalved()
}
- // Record last proposed height.
- gs.PutLastProposedHeight(header.Coinbase, header.Number)
+ if header.Coinbase != (common.Address{}) {
+ // Record last proposed height.
+ gs.PutLastProposedHeight(header.Coinbase, header.Number)
+ }
header.Root = state.IntermediateRoot(true)
return types.NewBlock(header, txs, uncles, receipts), nil