From 7b76aa2078d0b3419edccf37ca8634acca12fd6c Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 1 Sep 2020 22:46:36 +0300 Subject: [PATCH] warn when adding a nonce-gapped message to the mpool --- chain/messagepool/messagepool.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index 4b1204c4a..951c74a2c 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -194,6 +194,11 @@ func (ms *msgSet) add(m *types.SignedMessage, mp *MessagePool, strict bool) (boo return false, ErrTooManyPendingMessages } + if strict && nonceGap { + log.Warnf("adding nonce-gapped message from %s (nonce: %d, nextNonce: %d)", + m.Message.From, m.Message.Nonce, nextNonce) + } + ms.nextNonce = nextNonce ms.msgs[m.Message.Nonce] = m ms.requiredFunds.Add(ms.requiredFunds, m.Message.RequiredFunds().Int)