diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-06 14:32:06 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:22 +0800 |
commit | ccb4258f1abdea547e1ae4357c4be14043e315ca (patch) | |
tree | 82286644fde4746e8e524360db48896f063ae4df /dex/app.go | |
parent | cac86d014703004099ad9acef797e600e7032590 (diff) | |
download | go-tangerine-ccb4258f1abdea547e1ae4357c4be14043e315ca.tar go-tangerine-ccb4258f1abdea547e1ae4357c4be14043e315ca.tar.gz go-tangerine-ccb4258f1abdea547e1ae4357c4be14043e315ca.tar.bz2 go-tangerine-ccb4258f1abdea547e1ae4357c4be14043e315ca.tar.lz go-tangerine-ccb4258f1abdea547e1ae4357c4be14043e315ca.tar.xz go-tangerine-ccb4258f1abdea547e1ae4357c4be14043e315ca.tar.zst go-tangerine-ccb4258f1abdea547e1ae4357c4be14043e315ca.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, |