mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
core/txpool: fix error logs flood caused by removeAuthorities
This commit is contained in:
parent
7d8aca95d2
commit
77b28a010f
1 changed files with 4 additions and 3 deletions
|
|
@ -1765,12 +1765,12 @@ func (t *lookup) Remove(hash common.Hash) {
|
||||||
t.lock.Lock()
|
t.lock.Lock()
|
||||||
defer t.lock.Unlock()
|
defer t.lock.Unlock()
|
||||||
|
|
||||||
t.removeAuthorities(hash)
|
|
||||||
tx, ok := t.txs[hash]
|
tx, ok := t.txs[hash]
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Error("No transaction found to be deleted", "hash", hash)
|
log.Error("No transaction found to be deleted", "hash", hash)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
t.removeAuthorities(tx)
|
||||||
t.slots -= numSlots(tx)
|
t.slots -= numSlots(tx)
|
||||||
slotsGauge.Update(int64(t.slots))
|
slotsGauge.Update(int64(t.slots))
|
||||||
|
|
||||||
|
|
@ -1808,8 +1808,9 @@ func (t *lookup) addAuthorities(tx *types.Transaction) {
|
||||||
|
|
||||||
// removeAuthorities stops tracking the supplied tx in relation to its
|
// removeAuthorities stops tracking the supplied tx in relation to its
|
||||||
// authorities.
|
// authorities.
|
||||||
func (t *lookup) removeAuthorities(hash common.Hash) {
|
func (t *lookup) removeAuthorities(tx *types.Transaction) {
|
||||||
for addr := range t.auths {
|
hash := tx.Hash()
|
||||||
|
for _, addr := range tx.SetCodeAuthorities() {
|
||||||
list := t.auths[addr]
|
list := t.auths[addr]
|
||||||
// Remove tx from tracker.
|
// Remove tx from tracker.
|
||||||
if i := slices.Index(list, hash); i >= 0 {
|
if i := slices.Index(list, hash); i >= 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue