Commit 786c3c9e authored by Adin Schmahmann's avatar Adin Schmahmann

refactor: return nil instead of an empty record when processing an invalid record

parent f73b905e
......@@ -104,8 +104,7 @@ func (pm *ProtocolMessenger) GetValue(ctx context.Context, p peer.ID, key string
if err != nil {
logger.Debug("received invalid record (discarded)")
// return a sentinel to signify an invalid record was received
err = internal.ErrInvalidRecord
rec = new(recpb.Record)
return nil, peers, internal.ErrInvalidRecord
}
return rec, peers, err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment