Skip to content

Commit

Permalink
remove redundant error check
Browse files Browse the repository at this point in the history
fixes ipfs#154
  • Loading branch information
Stebalien committed Jun 3, 2018
1 parent 654c41b commit eb07ccd
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,10 @@ func (dht *IpfsDHT) putValueToPeer(ctx context.Context, p peer.ID,
pmes := pb.NewMessage(pb.Message_PUT_VALUE, key, 0)
pmes.Record = rec
rpmes, err := dht.sendRequest(ctx, p, pmes)
switch err {
case ErrReadTimeout:
log.Warningf("read timeout: %s %s", p.Pretty(), key)
fallthrough
default:
return err
case nil:
break
}

if err != nil {
if err == ErrReadTimeout {
log.Warningf("read timeout: %s %s", p.Pretty(), key)
}
return err
}

Expand Down

0 comments on commit eb07ccd

Please sign in to comment.