Skip to content

Commit

Permalink
Merge pull request #379 from ipfs-force-community/fix/invalid-errro-msg
Browse files Browse the repository at this point in the history
fix: ignore invalid error message
  • Loading branch information
simlecode authored Jun 24, 2024
2 parents e07c6b4 + e5999fb commit 18acbc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions publisher/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
pubsub "github.com/libp2p/go-libp2p-pubsub"
)

var errAlreadyInMpool = fmt.Errorf("already in mpool: validation failure")
var errMinimumNonce = errors.New("minimum expected nonce")
var errExistingNonce = errors.New("message with nonce already exists")

//go:generate mockgen -destination=../mocks/mock_msg_publisher.go -package=mocks github.com/ipfs-force-community/sophon-messager/publisher IMsgPublisher

Expand Down Expand Up @@ -173,7 +173,7 @@ func (n *nodeThread) run(ctx context.Context) {
case msgs := <-n.msgChan:
if msgCIDs, err := n.nodeClient.MpoolBatchPushUntrusted(ctx, msgs); err != nil {
// skip error
if !strings.Contains(err.Error(), errMinimumNonce.Error()) && !strings.Contains(err.Error(), errAlreadyInMpool.Error()) {
if !strings.Contains(err.Error(), errMinimumNonce.Error()) && !strings.Contains(err.Error(), errExistingNonce.Error()) {
var failedMsg []cid.Cid
for i := len(msgCIDs); i < len(msgs); i++ {
failedMsg = append(failedMsg, msgs[i].Cid())
Expand Down

0 comments on commit 18acbc5

Please sign in to comment.