From d20b6adfd2744bbde4774794fe85bf22755c3418 Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 3 Sep 2020 09:00:03 +0300 Subject: [PATCH] refuse to add duplicates in the mpool --- chain/messagepool/messagepool.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index 7fc4f2b9dea..e41e8b0c7d9 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -182,6 +182,9 @@ func (ms *msgSet) add(m *types.SignedMessage, mp *MessagePool, strict bool) (boo m.Message.From, m.Message.Nonce, minPrice, m.Message.GasPremium, ErrRBFTooLowPremium) } + } else { + return false, xerrors.Errorf("message from %s with nonce %d already in mpool: %w", + m.Message.From, m.Message.Nonce, ErrSoftValidationFailure) } ms.requiredFunds.Sub(ms.requiredFunds, exms.Message.RequiredFunds().Int)