Skip to content

Commit 8a40bef

Browse files
tompreStebalien
authored andcommitted
fix deadline calculation in Provide function of routing.go (#377)
1 parent 36578e2 commit 8a40bef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func (dht *IpfsDHT) Provide(ctx context.Context, key cid.Cid, brdcst bool) (err
418418
return context.DeadlineExceeded
419419
} else if timeout < 10*time.Second {
420420
// Reserve 10% for the final put.
421-
deadline = deadline.Add(timeout / 10)
421+
deadline = deadline.Add(-timeout / 10)
422422
} else {
423423
// Otherwise, reserve a second (we'll already be
424424
// connected so this should be fast).

0 commit comments

Comments
 (0)