aboutsummaryrefslogtreecommitdiffstats
path: root/consensus
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-10-16 19:26:29 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:50 +0800
commit2045312bf4b05539691a154b6d74a9d794e31add (patch)
tree9a089f2fc67a3317d8220b40464b4f08a7129632 /consensus
parent06fd0255cd83497c43b6c25aff3be470d0a3c91a (diff)
downloaddexon-2045312bf4b05539691a154b6d74a9d794e31add.tar
dexon-2045312bf4b05539691a154b6d74a9d794e31add.tar.gz
dexon-2045312bf4b05539691a154b6d74a9d794e31add.tar.bz2
dexon-2045312bf4b05539691a154b6d74a9d794e31add.tar.lz
dexon-2045312bf4b05539691a154b6d74a9d794e31add.tar.xz
dexon-2045312bf4b05539691a154b6d74a9d794e31add.tar.zst
dexon-2045312bf4b05539691a154b6d74a9d794e31add.zip
dex/core: misc bug fixes
Diffstat (limited to 'consensus')
-rw-r--r--consensus/dexcon/dexcon.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/consensus/dexcon/dexcon.go b/consensus/dexcon/dexcon.go
index c18e3cc6a..4017637b0 100644
--- a/consensus/dexcon/dexcon.go
+++ b/consensus/dexcon/dexcon.go
@@ -59,7 +59,13 @@ func (d *Dexcon) VerifyHeader(chain consensus.ChainReader, header *types.Header,
// method returns a quit channel to abort the operations and a results channel to
// retrieve the async verifications (the order is that of the input slice).
func (d *Dexcon) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error) {
- return make(chan struct{}), make(chan error)
+ abort, results := make(chan struct{}), make(chan error)
+ go func() {
+ for range headers {
+ results <- nil
+ }
+ }()
+ return abort, results
}
// verifyHeader checks whether a header conforms to the consensus rules.The
@@ -99,9 +105,10 @@ 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) {
- reward := new(big.Int).Div(d.config.BlockReward, new(big.Int).SetUint64(uint64(d.config.NumChains)))
+ blockReward := big.NewInt(100000000000)
+ reward := new(big.Int).Div(blockReward, new(big.Int).SetUint64(uint64(d.config.NumChains)))
state.AddBalance(header.Coinbase, reward)
- header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number))
+ header.Root = state.IntermediateRoot(true)
return types.NewBlock(header, txs, uncles, receipts), nil
}