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-03-12 12:19:09 +0800
commit88b272df86618979916a2b9f45723745dd556245 (patch)
tree7e33b4753e3920e65361991d695aeb1cadba92d1 /consensus
parent0c555d3f347dc8458ddae614b093c9b11d54e629 (diff)
downloaddexon-88b272df86618979916a2b9f45723745dd556245.tar
dexon-88b272df86618979916a2b9f45723745dd556245.tar.gz
dexon-88b272df86618979916a2b9f45723745dd556245.tar.bz2
dexon-88b272df86618979916a2b9f45723745dd556245.tar.lz
dexon-88b272df86618979916a2b9f45723745dd556245.tar.xz
dexon-88b272df86618979916a2b9f45723745dd556245.tar.zst
dexon-88b272df86618979916a2b9f45723745dd556245.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
}