diff options
-rw-r--r-- | consensus/dexcon/dexcon.go | 5 | ||||
-rw-r--r-- | params/config.go | 23 |
2 files changed, 14 insertions, 14 deletions
diff --git a/consensus/dexcon/dexcon.go b/consensus/dexcon/dexcon.go index 919e920dc..c3d42d599 100644 --- a/consensus/dexcon/dexcon.go +++ b/consensus/dexcon/dexcon.go @@ -27,8 +27,6 @@ import ( "github.com/dexon-foundation/dexon/rpc" ) -var blockReward = big.NewInt(5e+18) - // Config is the configuration for DEXON consensus. type Config struct { } @@ -101,7 +99,8 @@ func (d *Dexcon) Prepare(chain consensus.ChainReader, header *types.Header) erro // Finalize implements consensus.Engine, ensuring no uncles are set, nor block // 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) { - state.AddBalance(header.Coinbase, blockReward) + reward := new(big.Int).Div(d.config.MiningReward, new(big.Int).SetUint64(uint64(d.config.NumChains))) + state.AddBalance(header.Coinbase, reward) header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number)) return types.NewBlock(header, txs, uncles, receipts), nil diff --git a/params/config.go b/params/config.go index 44b708f0d..5158eddc4 100644 --- a/params/config.go +++ b/params/config.go @@ -219,17 +219,18 @@ func (c *CliqueConfig) String() string { // DexconConfig is the consensus engine configs for DEXON consensus. type DexconConfig struct { - GenesisCRSText string `json:"genesisCRSText"` - NumChains uint32 `json:"numChains"` - LambdaBA uint64 `json:"lambdaBA"` - LambdaDKG uint64 `json:"lambdaDKG"` - K int `json:"k"` - PhiRatio float32 `json:"phiRatio"` - NotarySetSize uint32 `json:"notarySetSize"` - DKGSetSize uint32 `json:"dkgSetSize"` - RoundInterval uint64 `json:"roundInterval"` - MinBlockInterval uint64 `json:"minBlockInterval"` - MaxBlockInterval uint64 `json:"maxBlockInterval"` + GenesisCRSText string `json:"genesisCRSText"` + NumChains uint32 `json:"numChains"` + LambdaBA uint64 `json:"lambdaBA"` + LambdaDKG uint64 `json:"lambdaDKG"` + K int `json:"k"` + PhiRatio float32 `json:"phiRatio"` + NotarySetSize uint32 `json:"notarySetSize"` + DKGSetSize uint32 `json:"dkgSetSize"` + RoundInterval uint64 `json:"roundInterval"` + MinBlockInterval uint64 `json:"minBlockInterval"` + MaxBlockInterval uint64 `json:"maxBlockInterval"` + MiningReward *big.Int `json:"miningReward"` } // String implements the stringer interface, returning the consensus engine details. |