Commit 277f2537 authored by Steven Allen's avatar Steven Allen

fix getLocal error handling

parent 95067a1c
......@@ -236,7 +236,7 @@ func (dht *IpfsDHT) getLocal(key string) (*recpb.Record, error) {
// Double check the key. Can't hurt.
if rec != nil && rec.GetKey() != key {
log.Errorf("BUG: found a DHT record that didn't match it's key: %s != %s", rec.GetKey(), key)
return nil, routing.ErrNotFound
return nil, nil
}
return rec, nil
......
......@@ -217,6 +217,8 @@ func (dht *IpfsDHT) handlePutValue(ctx context.Context, p peer.ID, pmes *pb.Mess
return pmes, err
}
// returns nil, nil when either nothing is found or the value found doesn't properly validate.
// returns nil, some_error when there's a *datastore* error (i.e., something goes very wrong)
func (dht *IpfsDHT) getRecordFromDatastore(dskey ds.Key) (*recpb.Record, error) {
reci, err := dht.datastore.Get(dskey)
if err == ds.ErrNotFound {
......
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