From 6a4b1252f9b199b11fa53ca135c760af7191ca16 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Wed, 6 Mar 2019 14:32:06 +0800 Subject: dex: fill in correct coinbase address (#223) Also remove app_test.go because of the refactor bojie@ is working on. --- dex/app.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'dex/app.go') 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, -- cgit v1.2.3