fix: no messages from storenode

This commit is contained in:
Richard Ramos 2023-01-18 18:27:00 -04:00 committed by r4bbit
parent 657933ec3d
commit ecbd3a70e9
1 changed files with 4 additions and 1 deletions

View File

@ -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