From cfbd1084e3ab87e7bd3a274b547a60cbe32f4a6a Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 21:35:40 +0000 Subject: [PATCH] docs: update mempool Select godoc (backport #15486) (#15489) Co-authored-by: Aleksandr Bezobchuk Co-authored-by: Julien Robert --- types/mempool/priority_nonce.go | 3 +++ types/mempool/sender_nonce.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/types/mempool/priority_nonce.go b/types/mempool/priority_nonce.go index 20e331bf194a..34250d37903f 100644 --- a/types/mempool/priority_nonce.go +++ b/types/mempool/priority_nonce.go @@ -306,6 +306,9 @@ func (i *PriorityNonceIterator) Tx() sdk.Tx { // // The maxBytes parameter defines the maximum number of bytes of transactions to // return. +// +// NOTE: It is not safe to use this iterator while removing transactions from +// the underlying mempool. func (mp *PriorityNonceMempool) Select(_ context.Context, _ [][]byte) Iterator { if mp.priorityIndex.Len() == 0 { return nil diff --git a/types/mempool/sender_nonce.go b/types/mempool/sender_nonce.go index 7f41482d69ca..69f9e498ceab 100644 --- a/types/mempool/sender_nonce.go +++ b/types/mempool/sender_nonce.go @@ -151,6 +151,9 @@ func (snm *SenderNonceMempool) Insert(_ context.Context, tx sdk.Tx) error { // Select returns an iterator ordering transactions the mempool with the lowest // nonce of a random selected sender first. +// +// NOTE: It is not safe to use this iterator while removing transactions from +// the underlying mempool. func (snm *SenderNonceMempool) Select(_ context.Context, _ [][]byte) Iterator { var senders []string