aboutsummaryrefslogtreecommitdiffstats
path: root/consensus
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-10-18 21:22:45 +0800
committerWei-Ning Huang <w@dexon.org>2018-12-19 20:54:27 +0800
commitab787f1ea7365b2befe6cd1bc9135637c32ec453 (patch)
tree46a169a06932e86c7da6efe53c51215ce6d994d1 /consensus
parent61bd9d4acef98adedc72543b40be8468d167f6c7 (diff)
downloaddexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar.gz
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar.bz2
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar.lz
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar.xz
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.tar.zst
dexon-ab787f1ea7365b2befe6cd1bc9135637c32ec453.zip
params: load blockReward from genesis JSON file
Diffstat (limited to 'consensus')
-rw-r--r--consensus/dexcon/dexcon.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/consensus/dexcon/dexcon.go b/consensus/dexcon/dexcon.go
index f7857c070..46090b757 100644
--- a/consensus/dexcon/dexcon.go
+++ b/consensus/dexcon/dexcon.go
@@ -106,8 +106,7 @@ func (d *Dexcon) Prepare(chain consensus.ChainReader, header *types.Header) erro
// rewards given, and returns the final block.
func (d *Dexcon) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error) {
// TODO(Bojie): remove it and get value from config
- blockReward := big.NewInt(1e+18)
- reward := new(big.Int).Div(blockReward, new(big.Int).SetUint64(uint64(d.config.NumChains)))
+ reward := new(big.Int).Div(d.config.BlockReward, new(big.Int).SetUint64(uint64(d.config.NumChains)))
state.AddBalance(header.Coinbase, reward)
header.Root = state.IntermediateRoot(true)