Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/txpool/txpool.go : used priceList.Put instead of heap.Push #26863

Merged
merged 2 commits into from
Mar 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package txpool

import (
"container/heap"
"errors"
"fmt"
"math"
Expand Down Expand Up @@ -750,7 +749,7 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (replaced bool, err e
// Add all transactions back to the priced queue
if replacesPending {
for _, dropTx := range drop {
heap.Push(&pool.priced.urgent, dropTx)
pool.priced.Put(dropTx, local || pool.locals.containsTx(dropTx))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These transactions are popped from the global price list, which are assumed non-local. You can simply pass the local=False here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These transactions are popped from the global price list, which are assumed non-local. You can simply pass the local=False here.

RIght

}
log.Trace("Discarding future transaction replacing pending tx", "hash", hash)
return false, ErrFutureReplacePending
Expand Down