mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +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()
|
||||
defer t.lock.Unlock()
|
||||
|
||||
t.removeAuthorities(hash)
|
||||
tx, ok := t.txs[hash]
|
||||
if !ok {
|
||||
log.Error("No transaction found to be deleted", "hash", hash)
|
||||
return
|
||||
}
|
||||
t.removeAuthorities(tx)
|
||||
t.slots -= numSlots(tx)
|
||||
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
|
||||
// authorities.
|
||||
func (t *lookup) removeAuthorities(hash common.Hash) {
|
||||
for addr := range t.auths {
|
||||
func (t *lookup) removeAuthorities(tx *types.Transaction) {
|
||||
hash := tx.Hash()
|
||||
for _, addr := range tx.SetCodeAuthorities() {
|
||||
list := t.auths[addr]
|
||||
// Remove tx from tracker.
|
||||
if i := slices.Index(list, hash); i >= 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue