File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -488,6 +488,20 @@ func (pool *TxPool) SetGasLimit(gasLimit uint64) {
488488 }
489489}
490490
491+ // handleDonutActivation removes from the pool all transactions without EIP-155 replay protection
492+ func (pool * TxPool ) handleDonutActivation () {
493+ toRemove := make (map [common.Hash ]struct {})
494+ pool .all .Range (func (hash common.Hash , tx * types.Transaction ) bool {
495+ if ! tx .Protected () {
496+ toRemove [hash ] = struct {}{}
497+ }
498+ return true
499+ })
500+ for hash := range toRemove {
501+ pool .removeTx (hash , false )
502+ }
503+ }
504+
491505// Nonce returns the next nonce of an account, with all transactions executable
492506// by the pool already applied on top.
493507func (pool * TxPool ) Nonce (addr common.Address ) uint64 {
@@ -1282,7 +1296,11 @@ func (pool *TxPool) reset(oldHead, newHead *types.Header) {
12821296 // Update all fork indicator by next pending block number.
12831297 next := new (big.Int ).Add (newHead .Number , big .NewInt (1 ))
12841298 pool .istanbul = pool .chainconfig .IsIstanbul (next )
1299+ wasDonut := pool .donut
12851300 pool .donut = pool .chainconfig .IsDonut (next )
1301+ if pool .donut && ! wasDonut {
1302+ pool .handleDonutActivation ()
1303+ }
12861304}
12871305
12881306// promoteExecutables moves transactions that have become processable from the
You can’t perform that action at this time.
0 commit comments