allow to replace sender's only txn in mempool

This commit is contained in:
Solovyov1796 2025-03-21 01:55:18 +08:00
parent 4c48f7ea63
commit 2c436a7d45

View File

@ -258,7 +258,7 @@ func (mp *PriorityNonceMempool) Insert(ctx context.Context, tx sdk.Tx) error {
continue
}
if indexSize > 1 {
if indexSize > 0 {
tail := index.Back()
if tail != nil {
tailKey := tail.Key().(txMeta)
@ -291,8 +291,6 @@ func (mp *PriorityNonceMempool) Insert(ctx context.Context, tx sdk.Tx) error {
)
}
} else {
// not found any index more than 1 except sender's index
// We do not replace the sender's only tx in the mempool
return errors.Wrapf(errMempoolIsFull, "%d@%s with priority%d", newKey.nonce, newKey.sender, newKey.priority)
}
} else {