Skip to content

Commit 77b28a0

Browse files
committed
core/txpool: fix error logs flood caused by removeAuthorities
1 parent 7d8aca9 commit 77b28a0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/txpool/legacypool/legacypool.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -1765,12 +1765,12 @@ func (t *lookup) Remove(hash common.Hash) {
17651765
t.lock.Lock()
17661766
defer t.lock.Unlock()
17671767

1768-
t.removeAuthorities(hash)
17691768
tx, ok := t.txs[hash]
17701769
if !ok {
17711770
log.Error("No transaction found to be deleted", "hash", hash)
17721771
return
17731772
}
1773+
t.removeAuthorities(tx)
17741774
t.slots -= numSlots(tx)
17751775
slotsGauge.Update(int64(t.slots))
17761776

@@ -1808,8 +1808,9 @@ func (t *lookup) addAuthorities(tx *types.Transaction) {
18081808

18091809
// removeAuthorities stops tracking the supplied tx in relation to its
18101810
// authorities.
1811-
func (t *lookup) removeAuthorities(hash common.Hash) {
1812-
for addr := range t.auths {
1811+
func (t *lookup) removeAuthorities(tx *types.Transaction) {
1812+
hash := tx.Hash()
1813+
for _, addr := range tx.SetCodeAuthorities() {
18131814
list := t.auths[addr]
18141815
// Remove tx from tracker.
18151816
if i := slices.Index(list, hash); i >= 0 {

0 commit comments

Comments
 (0)