mirror of
https://github.com/0glabs/0g-chain.git
synced 2025-04-01 14:26:02 +00:00
add new interface to query the uncommitted txn count for sender
This commit is contained in:
parent
d8e968146b
commit
2cc584be0b
@ -495,6 +495,16 @@ func (mp *PriorityNonceMempool) doSelect(_ context.Context, _ [][]byte) mempool.
|
||||
return iterator.iteratePriority()
|
||||
}
|
||||
|
||||
func (mp *PriorityNonceMempool) GetSenderUncommittedTxnCount(ctx context.Context, sender string) int {
|
||||
mp.mtx.Lock()
|
||||
defer mp.mtx.Unlock()
|
||||
|
||||
if _, exists := mp.counterBySender[sender]; exists {
|
||||
return mp.counterBySender[sender]
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type reorderKey struct {
|
||||
deleteKey txMeta
|
||||
insertKey txMeta
|
||||
|
Loading…
Reference in New Issue
Block a user