From eabffa1f577d951acaff1db77a45c073c7993da0 Mon Sep 17 00:00:00 2001 From: Lee Date: Wed, 5 Jun 2024 16:55:02 +0800 Subject: [PATCH] fix: continue replacing other messages when a message is not found in mpool (#14) --- service.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service.go b/service.go index 5345835..8270e42 100644 --- a/service.go +++ b/service.go @@ -890,8 +890,10 @@ func (s *Service) replaceMessage(ctx context.Context, id uint, mss *api.MessageS } } + // If the message is not found in the mpool, skip it and continue with the next one if found == nil { - return fmt.Errorf("no pending message found from %s with nonce %d", cm.From, cm.Nonce) + sLog.Warn("message not found in mpool, skipping") + return nil } msg := found.Message