aboutsummaryrefslogtreecommitdiffstats
path: root/consensus/dexcon/dexcon.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-10-16 19:26:29 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:23:39 +0800
commit7d938ac7fd4f787f6e4507ce69c6acc677eb8080 (patch)
tree664c98a1f37787d4352d2527b4f6752d9b9bc755 /consensus/dexcon/dexcon.go
parentab284ca86e5181cbd009aaa1e9b49d56eb532f97 (diff)
downloadgo-tangerine-7d938ac7fd4f787f6e4507ce69c6acc677eb8080.tar
go-tangerine-7d938ac7fd4f787f6e4507ce69c6acc677eb8080.tar.gz
go-tangerine-7d938ac7fd4f787f6e4507ce69c6acc677eb8080.tar.bz2
go-tangerine-7d938ac7fd4f787f6e4507ce69c6acc677eb8080.tar.lz
go-tangerine-7d938ac7fd4f787f6e4507ce69c6acc677eb8080.tar.xz
go-tangerine-7d938ac7fd4f787f6e4507ce69c6acc677eb8080.tar.zst
go-tangerine-7d938ac7fd4f787f6e4507ce69c6acc677eb8080.zip
dex/core: misc bug fixes
Diffstat (limited to 'consensus/dexcon/dexcon.go')
-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
}