aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-08-17 20:47:14 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-08-17 20:47:14 +0800
commit22cd3f70a68da31b1054fcfca74d187133df29b8 (patch)
tree62c60b610eb83249317e769f8eb05f6d59dc9169 /miner
parent2695fa2213fe5010a80970bca1078834662d5972 (diff)
downloaddexon-22cd3f70a68da31b1054fcfca74d187133df29b8.tar
dexon-22cd3f70a68da31b1054fcfca74d187133df29b8.tar.gz
dexon-22cd3f70a68da31b1054fcfca74d187133df29b8.tar.bz2
dexon-22cd3f70a68da31b1054fcfca74d187133df29b8.tar.lz
dexon-22cd3f70a68da31b1054fcfca74d187133df29b8.tar.xz
dexon-22cd3f70a68da31b1054fcfca74d187133df29b8.tar.zst
dexon-22cd3f70a68da31b1054fcfca74d187133df29b8.zip
miner: update mining log with correct fee calculation
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/miner/worker.go b/miner/worker.go
index e7e279645..2f76f2a92 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -782,8 +782,8 @@ func (w *worker) commit(uncles []*types.Header, interval func(), update bool, st
w.unconfirmed.Shift(block.NumberU64() - 1)
feesWei := new(big.Int)
- for _, tx := range block.Transactions() {
- feesWei.Add(feesWei, new(big.Int).Mul(new(big.Int).SetUint64(tx.Gas()), tx.GasPrice()))
+ for i, tx := range block.Transactions() {
+ 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)))