aboutsummaryrefslogtreecommitdiffstats
path: root/light/txpool.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-11-13 19:47:27 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-03 20:45:35 +0800
commit6f69cdd109b1dd692b8dfb15e7c53d2051fbc946 (patch)
treec92974f8b82209073ad1ee3faec6e149f834bf69 /light/txpool.go
parentb8caba97099ee5eed33c3b80dd4ea540722e7d8f (diff)
downloadgo-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar
go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.gz
go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.bz2
go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.lz
go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.xz
go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.zst
go-tangerine-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.zip
all: switch gas limits from big.Int to uint64
Diffstat (limited to 'light/txpool.go')
-rw-r--r--light/txpool.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/light/txpool.go b/light/txpool.go
index bd215b992..ca41490bd 100644
--- a/light/txpool.go
+++ b/light/txpool.go
@@ -358,7 +358,7 @@ func (pool *TxPool) validateTx(ctx context.Context, tx *types.Transaction) error
// Check the transaction doesn't exceed the current
// block limit gas.
header := pool.chain.GetHeaderByHash(pool.head)
- if header.GasLimit.Cmp(tx.Gas()) < 0 {
+ if header.GasLimit < tx.Gas() {
return core.ErrGasLimit
}
@@ -376,10 +376,13 @@ func (pool *TxPool) validateTx(ctx context.Context, tx *types.Transaction) error
}
// Should supply enough intrinsic gas
- if tx.Gas().Cmp(core.IntrinsicGas(tx.Data(), tx.To() == nil, pool.homestead)) < 0 {
+ gas, err := core.IntrinsicGas(tx.Data(), tx.To() == nil, pool.homestead)
+ if err != nil {
+ return err
+ }
+ if tx.Gas() < gas {
return core.ErrIntrinsicGas
}
-
return currentState.Error()
}