core: more efficient nonce-update in txpool (#22231)
* Adjust pending nonce update operation Benchmark the speed of transaction insertion under multiple accounts core: fix rebase issues + docstring core: make benchmark test use sync:ed method * core: address review comments * core: add memreport to benchmark Co-authored-by: WeiLoy <wei_loy@163.com>
This commit is contained in:
committed by
GitHub
parent
f49e90e32c
commit
03bc8b7858
@ -77,3 +77,11 @@ func (txn *txNoncer) setIfLower(addr common.Address, nonce uint64) {
|
||||
}
|
||||
txn.nonces[addr] = nonce
|
||||
}
|
||||
|
||||
// setAll sets the nonces for all accounts to the given map.
|
||||
func (txn *txNoncer) setAll(all map[common.Address]uint64) {
|
||||
txn.lock.Lock()
|
||||
defer txn.lock.Unlock()
|
||||
|
||||
txn.nonces = all
|
||||
}
|
||||
|
Reference in New Issue
Block a user