add sanity check in SearchForIndexedMsg call site

Check that receipt is non nil, and the message was indeed found.
This commit is contained in:
vyzo 2023-03-16 17:51:28 +02:00 committed by Maciej Witowski
parent 6092f9cc14
commit 2985592bd0

View File

@ -151,7 +151,17 @@ func (sm *StateManager) SearchForMessage(ctx context.Context, head *types.TipSet
switch {
case err == nil:
return fts, r, foundMsg, nil
if r != nil && foundMsg.Defined() {
return fts, r, foundMsg, nil
}
// debug log this, it's noteworthy
if r == nil {
log.Debugf("missing receipt for message in index for %s", mcid)
}
if !foundMsg.Defined() {
log.Debugf("message %s not found", mcid)
}
case errors.Is(err, index.ErrNotFound):
// ok for the index to have incomplete data