aboutsummaryrefslogtreecommitdiffstats
path: root/dex/app.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-03-06 14:32:06 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:57 +0800
commit2cc2ac2e771daa7598ca8dd80722a847bdc2749a (patch)
tree28ace5e2beb4b398a93b7cfd381b50c521cb02b6 /dex/app.go
parent9bb967aa96facf62765762dd17bedb9cb6c69c79 (diff)
downloaddexon-2cc2ac2e771daa7598ca8dd80722a847bdc2749a.tar.gz
dexon-2cc2ac2e771daa7598ca8dd80722a847bdc2749a.tar.zst
dexon-2cc2ac2e771daa7598ca8dd80722a847bdc2749a.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.go11
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,