aboutsummaryrefslogtreecommitdiffstats
path: root/light
diff options
context:
space:
mode:
Diffstat (limited to 'light')
-rw-r--r--light/txpool.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/light/txpool.go b/light/txpool.go
index e945ef2ec..11a0e76ae 100644
--- a/light/txpool.go
+++ b/light/txpool.go
@@ -19,6 +19,7 @@ package light
import (
"context"
"fmt"
+ "math/big"
"sync"
"time"
@@ -67,7 +68,7 @@ type TxPool struct {
mined map[common.Hash][]*types.Transaction // mined transactions by block hash
clearIdx uint64 // earliest block nr that can contain mined tx info
- homestead bool
+ istanbul bool // Fork indicator whether we are in the istanbul stage.
}
// TxRelayBackend provides an interface to the mechanism that forwards transacions
@@ -309,8 +310,10 @@ func (pool *TxPool) setNewHead(head *types.Header) {
txc, _ := pool.reorgOnNewHead(ctx, head)
m, r := txc.getLists()
pool.relay.NewHead(pool.head, m, r)
- pool.homestead = pool.config.IsHomestead(head.Number)
- pool.signer = types.MakeSigner(pool.config, head.Number)
+
+ // Update fork indicator by next pending block number
+ next := new(big.Int).Add(head.Number, big.NewInt(1))
+ pool.istanbul = pool.config.IsIstanbul(next)
}
// Stop stops the light transaction pool
@@ -378,7 +381,7 @@ func (pool *TxPool) validateTx(ctx context.Context, tx *types.Transaction) error
}
// Should supply enough intrinsic gas
- gas, err := core.IntrinsicGas(tx.Data(), tx.To() == nil, pool.homestead)
+ gas, err := core.IntrinsicGas(tx.Data(), tx.To() == nil, true, pool.istanbul)
if err != nil {
return err
}