@@ -274,11 +274,7 @@ type TxPool struct {
274274 signer types.Signer
275275 mu sync.RWMutex
276276
277- txFeed event.Feed
278277 dropTxFeed event.Feed
279- scope event.SubscriptionScope
280- signer types.Signer
281- mu sync.RWMutex
282278 istanbul atomic.Bool // Fork indicator whether we are in the istanbul stage.
283279 eip2718 atomic.Bool // Fork indicator whether we are using EIP-2718 type transactions.
284280 eip1559 atomic.Bool // Fork indicator whether we are using EIP-1559 type transactions.
@@ -457,10 +453,7 @@ func (pool *TxPool) loop() {
457453 for _ , tx = range list {
458454 toRemove = append (toRemove , tx .Hash ())
459455 }
460- pool .dropTxFeed .Send (DropTxsEvent {
461- Txs : list ,
462- Reason : dropOld ,
463- })
456+
464457 queuedEvictionMeter .Mark (int64 (len (list )))
465458 }
466459 }
@@ -514,12 +507,6 @@ func (pool *TxPool) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subsc
514507 return pool .scope .Track (pool .txFeed .Subscribe (ch ))
515508}
516509
517- // SubscribeDropTxsEvent registers a subscription of DropTxsEvent and
518- // starts sending event to the given channel.
519- func (pool * TxPool ) SubscribeDropTxsEvent (ch chan <- DropTxsEvent ) event.Subscription {
520- return pool .scope .Track (pool .dropTxFeed .Subscribe (ch ))
521- }
522-
523510// GasPrice returns the current gas price enforced by the transaction pool.
524511func (pool * TxPool ) GasPrice () * big.Int {
525512 pool .gasPriceMu .RLock ()
@@ -562,10 +549,6 @@ func (pool *TxPool) SetGasPrice(price *big.Int) {
562549 }
563550
564551 pool .priced .Removed (len (drop ))
565- pool .dropTxFeed .Send (DropTxsEvent {
566- Txs : drop ,
567- Reason : dropGasPriceUpdated ,
568- })
569552 }
570553
571554 log .Info ("Transaction pool price threshold updated" , "price" , price )
@@ -1001,10 +984,6 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (replaced bool, err e
1001984 dropped := pool .removeTx (tx .Hash (), false )
1002985 pool .changesSinceReorg += dropped
1003986 }
1004- pool .dropTxFeed .Send (DropTxsEvent {
1005- Txs : drop ,
1006- Reason : dropUnderpriced ,
1007- })
1008987 }
1009988
1010989 // Try to replace an existing transaction in the pending pool
@@ -1026,11 +1005,6 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (replaced bool, err e
10261005 pool .all .Remove (old .Hash ())
10271006 pool .priced .Removed (1 )
10281007 pendingReplaceMeter .Mark (1 )
1029- pool .dropTxFeed .Send (DropTxsEvent {
1030- Txs : []* types.Transaction {old },
1031- Reason : dropReplaced ,
1032- Replacement : tx ,
1033- })
10341008 }
10351009
10361010 pool .all .Add (tx , isLocal )
@@ -1106,10 +1080,6 @@ func (pool *TxPool) enqueueTx(hash common.Hash, tx *types.Transaction, local boo
11061080 pool .all .Remove (old .Hash ())
11071081 pool .priced .Removed (1 )
11081082 queuedReplaceMeter .Mark (1 )
1109- pool .dropTxFeed .Send (DropTxsEvent {
1110- Txs : []* types.Transaction {old },
1111- Reason : dropReplaced ,
1112- })
11131083 } else {
11141084 // Nothing was replaced, bump the queued counter
11151085 queuedGauge .Inc (1 )
@@ -1187,10 +1157,6 @@ func (pool *TxPool) promoteTx(addr common.Address, hash common.Hash, tx *types.T
11871157 pool .all .Remove (old .Hash ())
11881158 pool .priced .Removed (1 )
11891159 pendingReplaceMeter .Mark (1 )
1190- pool .dropTxFeed .Send (DropTxsEvent {
1191- Txs : []* types.Transaction {old },
1192- Reason : dropReplaced ,
1193- })
11941160 } else {
11951161 // Nothing was replaced, bump the pending counter
11961162 pendingGauge .Inc (1 )
@@ -1526,10 +1492,6 @@ func (pool *TxPool) removeTx(hash common.Hash, outofbound bool) int {
15261492
15271493 // Reduce the pending counter
15281494 pendingGauge .Dec (int64 (1 + len (invalids )))
1529- pool .dropTxFeed .Send (DropTxsEvent {
1530- Txs : invalids ,
1531- Reason : dropUnexecutable ,
1532- })
15331495
15341496 return 1 + len (invalids )
15351497 }
@@ -1985,11 +1947,6 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) []*types.Trans
19851947
19861948 log .Trace ("Removed old queued transactions" , "count" , forwardsLen )
19871949
1988- pool .dropTxFeed .Send (DropTxsEvent {
1989- Txs : forwards ,
1990- Reason : dropLowNonce ,
1991- })
1992-
19931950 // Drop all transactions that are too costly (low balance or out of gas)
19941951 balance .SetFromBig (pool .currentState .GetBalance (addr ))
19951952
@@ -2003,10 +1960,6 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) []*types.Trans
20031960
20041961 log .Trace ("Removed unpayable queued transactions" , "count" , dropsLen )
20051962 queuedNofundsMeter .Mark (int64 (dropsLen ))
2006- pool .dropTxFeed .Send (DropTxsEvent {
2007- Txs : drops ,
2008- Reason : dropUnpayable ,
2009- })
20101963
20111964 // Gather all executable transactions and promote them
20121965 readies = list .Ready (pool .pendingNonces .get (addr ))
@@ -2035,10 +1988,6 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) []*types.Trans
20351988 }
20361989
20371990 queuedRateLimitMeter .Mark (int64 (capsLen ))
2038- pool .dropTxFeed .Send (DropTxsEvent {
2039- Txs : caps ,
2040- Reason : dropAccountCap ,
2041- })
20421991 }
20431992
20441993 // Mark all the items dropped as removed
@@ -2160,11 +2109,6 @@ func (pool *TxPool) truncatePending() {
21602109 log .Trace ("Removed fairness-exceeding pending transaction" , "hash" , hash )
21612110 }
21622111
2163- pool .dropTxFeed .Send (DropTxsEvent {
2164- Txs : caps ,
2165- Reason : dropAccountCap ,
2166- })
2167-
21682112 pool .priced .Removed (capsLen )
21692113 pendingGauge .Dec (int64 (capsLen ))
21702114
@@ -2205,11 +2149,6 @@ func (pool *TxPool) truncatePending() {
22052149 log .Trace ("Removed fairness-exceeding pending transaction" , "hash" , hash )
22062150 }
22072151
2208- pool .dropTxFeed .Send (DropTxsEvent {
2209- Txs : caps ,
2210- Reason : dropAccountCap ,
2211- })
2212-
22132152 pool .priced .Removed (capsLen )
22142153
22152154 pendingGauge .Dec (int64 (capsLen ))
@@ -2280,10 +2219,6 @@ func (pool *TxPool) truncateQueue() {
22802219 for _ , tx = range listFlatten {
22812220 pool .removeTx (tx .Hash (), true )
22822221 }
2283- pool .dropTxFeed .Send (DropTxsEvent {
2284- Txs : txs ,
2285- Reason : dropTruncating ,
2286- })
22872222
22882223 drop -= size
22892224 queuedRateLimitMeter .Mark (int64 (size ))
@@ -2301,12 +2236,6 @@ func (pool *TxPool) truncateQueue() {
23012236 pool .removeTx (txs [i ].Hash (), true )
23022237
23032238 drop --
2304-
2305- queuedRateLimitMeter .Mark (1 )
2306- pool .dropTxFeed .Send (DropTxsEvent {
2307- Txs : []* types.Transaction {txs [i ]},
2308- Reason : dropTruncating ,
2309- })
23102239 }
23112240 }
23122241}
@@ -2349,10 +2278,7 @@ func (pool *TxPool) demoteUnexecutables() {
23492278 pool .all .Remove (hash )
23502279 log .Trace ("Removed old pending transaction" , "hash" , hash )
23512280 }
2352- pool .dropTxFeed .Send (DropTxsEvent {
2353- Txs : olds ,
2354- Reason : dropLowNonce ,
2355- })
2281+
23562282 // Drop all transactions that are too costly (low balance or out of gas), and queue any invalids back for later
23572283 balance .SetFromBig (pool .currentState .GetBalance (addr ))
23582284 drops , invalids := list .Filter (balance , pool .currentMaxGas .Load ())
@@ -2366,10 +2292,6 @@ func (pool *TxPool) demoteUnexecutables() {
23662292
23672293 pool .all .Remove (hash )
23682294 }
2369- pool .dropTxFeed .Send (DropTxsEvent {
2370- Txs : drops ,
2371- Reason : dropUnpayable ,
2372- })
23732295
23742296 pendingNofundsMeter .Mark (int64 (dropsLen ))
23752297
0 commit comments