aboutsummaryrefslogtreecommitdiffstats
path: root/eth/gasprice.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-07-07 03:41:55 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-07-07 03:41:55 +0800
commitd764bd058457cd9eb91d205d1ac187d40c4866d6 (patch)
treef511d3be2c9fd33974ac72f4168e0e820f0ff4ec /eth/gasprice.go
parent45618d5f6bd1cd5e046fe0f0e07746b3af4cf55a (diff)
parent666a7dda369e9a30715f560c8f72b81735a347fc (diff)
downloaddexon-d764bd058457cd9eb91d205d1ac187d40c4866d6.tar
dexon-d764bd058457cd9eb91d205d1ac187d40c4866d6.tar.gz
dexon-d764bd058457cd9eb91d205d1ac187d40c4866d6.tar.bz2
dexon-d764bd058457cd9eb91d205d1ac187d40c4866d6.tar.lz
dexon-d764bd058457cd9eb91d205d1ac187d40c4866d6.tar.xz
dexon-d764bd058457cd9eb91d205d1ac187d40c4866d6.tar.zst
dexon-d764bd058457cd9eb91d205d1ac187d40c4866d6.zip
Merge pull request #1423 from obscuren/gasused-receipt-fix
core, eth, rpc: proper gas used. Closes #1422
Diffstat (limited to 'eth/gasprice.go')
-rw-r--r--eth/gasprice.go4
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(),