From 6f69cdd109b1dd692b8dfb15e7c53d2051fbc946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Mon, 13 Nov 2017 13:47:27 +0200 Subject: all: switch gas limits from big.Int to uint64 --- light/txpool.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'light/txpool.go') 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() } -- cgit v1.2.3