Skip to content

Commit

Permalink
bitswap: make use of default broadcast delay on initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanjuan authored and hacdias committed Nov 22, 2023
1 parent 11e43b9 commit 9999444
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bitswap/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func New(parent context.Context, network bsnet.BitSwapNetwork, bstore blockstore
dupMetric: bmetrics.DupHist(ctx),
allMetric: bmetrics.AllHist(ctx),
provSearchDelay: defaults.ProvSearchDelay,
rebroadcastDelay: delay.Fixed(time.Minute),
rebroadcastDelay: delay.Fixed(defaults.RebroadcastDelay),
simulateDontHavesOnTimeout: true,
}

Expand Down
6 changes: 1 addition & 5 deletions bitswap/internal/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package defaults
import (
"encoding/binary"
"time"

delay "github.com/ipfs/go-ipfs-delay"
)

const (
Expand Down Expand Up @@ -35,10 +33,8 @@ const (
// FIXME: expose this in go-verifcid.
MaximumHashLength = 128
MaximumAllowedCid = binary.MaxVarintLen64*4 + MaximumHashLength
)

var (
// RebroadcastDelay is the default delay to trigger broadcast of
// random CIDs in the wantlist.
RebroadcastDelay = delay.Fixed(time.Minute)
RebroadcastDelay = time.Minute
)

0 comments on commit 9999444

Please sign in to comment.