From ecbd3a70e9ee36134104e26ce856be0d13f6ae58 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 18 Jan 2023 18:27:00 -0400 Subject: [PATCH] fix: no messages from storenode --- wakuv2/waku.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wakuv2/waku.go b/wakuv2/waku.go index cf8d9aa44..47455f6d0 100644 --- a/wakuv2/waku.go +++ b/wakuv2/waku.go @@ -1140,7 +1140,10 @@ func (w *Waku) Query(peerID peer.ID, topics []common.TopicType, from uint64, to defer cancel() result, err := w.node.Store().Query(ctx, query, opts...) - if err != nil { + if err != nil && errors.Is(err, store.ErrEmptyResponse) { + // No messages + return nil, nil + } else if err != nil { w.logger.Error("error querying storenode", zap.String("peerID", peerID.String()), zap.Error(err)) signal.SendHistoricMessagesRequestFailed(requestID, peerID, err) return nil, err