diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-06 14:32:06 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 6a4b1252f9b199b11fa53ca135c760af7191ca16 (patch) | |
tree | 61535080d0b31c37cf8a45372163bb36a517424b /dex/app.go | |
parent | c110f44b7cff316435b1acc7cdd2667a88bb0088 (diff) | |
download | dexon-6a4b1252f9b199b11fa53ca135c760af7191ca16.tar dexon-6a4b1252f9b199b11fa53ca135c760af7191ca16.tar.gz dexon-6a4b1252f9b199b11fa53ca135c760af7191ca16.tar.bz2 dexon-6a4b1252f9b199b11fa53ca135c760af7191ca16.tar.lz dexon-6a4b1252f9b199b11fa53ca135c760af7191ca16.tar.xz dexon-6a4b1252f9b199b11fa53ca135c760af7191ca16.tar.zst dexon-6a4b1252f9b199b11fa53ca135c760af7191ca16.zip |
dex: fill in correct coinbase address (#223)
Also remove app_test.go because of the refactor bojie@ is working on.
Diffstat (limited to 'dex/app.go')
-rw-r--r-- | dex/app.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/dex/app.go b/dex/app.go index 6ef20684f..e7fdbb4fe 100644 --- a/dex/app.go +++ b/dex/app.go @@ -488,10 +488,19 @@ func (d *DexconApp) BlockDelivered( panic(err) } + var owner common.Address + if !block.IsEmpty() { + gs := d.gov.GetStateForConfigAtRound(block.Position.Round) + owner, err = gs.GetNodeOwnerByID(block.ProposerID) + if err != nil { + panic(err) + } + } + newBlock := types.NewBlock(&types.Header{ Number: new(big.Int).SetUint64(result.Height), Time: big.NewInt(result.Timestamp.UnixNano() / 1000000), - Coinbase: common.BytesToAddress(block.ProposerID.Bytes()), + Coinbase: owner, GasLimit: d.gov.DexconConfiguration(block.Position.Round).BlockGasLimit, Difficulty: big.NewInt(1), Round: block.Position.Round, |