aboutsummaryrefslogtreecommitdiffstats
path: root/core/blockchain.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-01-03 22:53:06 +0800
committerGitHub <noreply@github.com>2018-01-03 22:53:06 +0800
commit762f3a48a00da02fe58063cb6ce8dc2d08821f15 (patch)
tree783421f8ece4306f69cb17e515ee07c1ab4fe0eb /core/blockchain.go
parentb47285f1cf0cb475f29322ceb9fac4d7e1cfb11f (diff)
parent6f69cdd109b1dd692b8dfb15e7c53d2051fbc946 (diff)
downloaddexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.gz
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.bz2
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.lz
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.xz
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.zst
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.zip
Merge pull request #15466 from karalabe/uint64-gas-limit
all: switch gas limits from big.Int to uint64
Diffstat (limited to 'core/blockchain.go')
-rw-r--r--core/blockchain.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/blockchain.go b/core/blockchain.go
index 812f9e562..737fbe3ee 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -305,7 +305,7 @@ func (bc *BlockChain) FastSyncCommitHead(hash common.Hash) error {
}
// GasLimit returns the gas limit of the current HEAD block.
-func (bc *BlockChain) GasLimit() *big.Int {
+func (bc *BlockChain) GasLimit() uint64 {
bc.mu.RLock()
defer bc.mu.RUnlock()
@@ -677,9 +677,9 @@ func SetReceiptsData(config *params.ChainConfig, block *types.Block, receipts ty
}
// The used gas can be calculated based on previous receipts
if j == 0 {
- receipts[j].GasUsed = new(big.Int).Set(receipts[j].CumulativeGasUsed)
+ receipts[j].GasUsed = receipts[j].CumulativeGasUsed
} else {
- receipts[j].GasUsed = new(big.Int).Sub(receipts[j].CumulativeGasUsed, receipts[j-1].CumulativeGasUsed)
+ receipts[j].GasUsed = receipts[j].CumulativeGasUsed - receipts[j-1].CumulativeGasUsed
}
// The derived log fields can simply be set from the block and transaction
for k := 0; k < len(receipts[j].Logs); k++ {
@@ -1002,7 +1002,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks) (int, []interface{}, []*ty
events = append(events, ChainSideEvent{block})
}
stats.processed++
- stats.usedGas += usedGas.Uint64()
+ stats.usedGas += usedGas
stats.report(chain, i)
}
// Append a single chain head event if we've progressed the chain