Skip to content

Commit

Permalink
Merge pull request ipfs#155 from libp2p/fix/154
Browse files Browse the repository at this point in the history
remove redundant error check
  • Loading branch information
Stebalien authored Jun 7, 2018
2 parents 2a5314f + eb07ccd commit 53421fc
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 @@ -148,17 +148,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 53421fc

Please sign in to comment.