-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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 : fix map size avoid resizing #27221
Conversation
core/txpool/txpool.go
Outdated
@@ -581,7 +581,7 @@ func (pool *TxPool) Locals() []common.Address { | |||
// account and sorted by nonce. The returned transaction set is a copy and can be | |||
// freely modified by calling code. | |||
func (pool *TxPool) local() map[common.Address]types.Transactions { | |||
txs := make(map[common.Address]types.Transactions) | |||
txs := make(map[common.Address]types.Transactions, len(pool.locals.accounts)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not that obvious. There may be many local accounts but no transactions from them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not that obvious. There may be many local accounts but no transactions from them.
Yes, it may be, for some public RPC nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
This reverts commit cd43de7.
This reverts commit cd43de7.
No description provided.