From 7d938ac7fd4f787f6e4507ce69c6acc677eb8080 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Tue, 16 Oct 2018 19:26:29 +0800 Subject: dex/core: misc bug fixes --- consensus/dexcon/dexcon.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'consensus/dexcon/dexcon.go') 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 } -- cgit v1.2.3