Skip to content

Commit

Permalink
fix deadline calculation in Provide function of routing.go (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
tompre authored and Stebalien committed Jul 23, 2019
1 parent 36578e2 commit 8a40bef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ func (dht *IpfsDHT) Provide(ctx context.Context, key cid.Cid, brdcst bool) (err
return context.DeadlineExceeded
} else if timeout < 10*time.Second {
// Reserve 10% for the final put.
deadline = deadline.Add(timeout / 10)
deadline = deadline.Add(-timeout / 10)
} else {
// Otherwise, reserve a second (we'll already be
// connected so this should be fast).
Expand Down

0 comments on commit 8a40bef

Please sign in to comment.