miner: update mining log with correct fee calculation

This commit is contained in:
Péter Szilágyi 2018-08-17 15:47:14 +03:00
parent 2695fa2213
commit 22cd3f70a6
No known key found for this signature in database
GPG Key ID: E9AE538CEDF8293D

View File

@ -782,8 +782,8 @@ func (w *worker) commit(uncles []*types.Header, interval func(), update bool, st
w.unconfirmed.Shift(block.NumberU64() - 1) w.unconfirmed.Shift(block.NumberU64() - 1)
feesWei := new(big.Int) feesWei := new(big.Int)
for _, tx := range block.Transactions() { for i, tx := range block.Transactions() {
feesWei.Add(feesWei, new(big.Int).Mul(new(big.Int).SetUint64(tx.Gas()), tx.GasPrice())) feesWei.Add(feesWei, new(big.Int).Mul(new(big.Int).SetUint64(receipts[i].GasUsed), tx.GasPrice()))
} }
feesEth := new(big.Float).Quo(new(big.Float).SetInt(feesWei), new(big.Float).SetInt(big.NewInt(params.Ether))) feesEth := new(big.Float).Quo(new(big.Float).SetInt(feesWei), new(big.Float).SetInt(big.NewInt(params.Ether)))