diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-07 02:59:12 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-07 03:18:24 +0800 |
commit | 666a7dda369e9a30715f560c8f72b81735a347fc (patch) | |
tree | 62011e66bba6335bf4c7693d796c4757395e248e /eth | |
parent | 4c30f0f9ac33e02908c6848744dafff9031b86f3 (diff) | |
download | dexon-666a7dda369e9a30715f560c8f72b81735a347fc.tar.gz dexon-666a7dda369e9a30715f560c8f72b81735a347fc.tar.zst dexon-666a7dda369e9a30715f560c8f72b81735a347fc.zip |
core, eth, rpc: proper gas used. Closes #1417
Added some additional backward compatibility code for old receipts
Diffstat (limited to 'eth')
-rw-r--r-- | eth/gasprice.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/eth/gasprice.go b/eth/gasprice.go index 09ef8cded..4aa2ad295 100644 --- a/eth/gasprice.go +++ b/eth/gasprice.go @@ -134,7 +134,9 @@ func (self *GasPriceOracle) lowestPrice(block *types.Block) *big.Int { receipts := self.eth.BlockProcessor().GetBlockReceipts(block.Hash()) if len(receipts) > 0 { - gasUsed = receipts[len(receipts)-1].CumulativeGasUsed + if cgu := receipts[len(receipts)-1].CumulativeGasUsed; cgu != nil { + gasUsed = receipts[len(receipts)-1].CumulativeGasUsed + } } if new(big.Int).Mul(gasUsed, big.NewInt(100)).Cmp(new(big.Int).Mul(block.GasLimit(), |