From b61281ba4bea27b334343e2a1ebc65663e736146 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 13 Oct 2020 15:06:47 -0700 Subject: [PATCH] fix a panic on startup when we fail to load the tipset There may be a deeper issue here, but we need to handle this more gracefully somehow. See #4358. --- chain/messagepool/messagepool.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index d3c638b22..83b1a7f29 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -670,6 +670,10 @@ func (mp *MessagePool) addLoaded(m *types.SignedMessage) error { curTs := mp.curTs + if curTs == nil { + return xerrors.Errorf("current tipset not loaded") + } + snonce, err := mp.getStateNonce(m.Message.From, curTs) if err != nil { return xerrors.Errorf("failed to look up actor state nonce: %s: %w", err, ErrSoftValidationFailure)