refuse to add duplicates in the mpool

This commit is contained in:
vyzo 2020-09-03 09:00:03 +03:00
parent a4c650316a
commit d20b6adfd2

View File

@ -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, m.Message.From, m.Message.Nonce, minPrice, m.Message.GasPremium,
ErrRBFTooLowPremium) 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) ms.requiredFunds.Sub(ms.requiredFunds, exms.Message.RequiredFunds().Int)