From 999944499b4968106c9c31a4eae601987787f28b Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 22 Nov 2023 12:27:57 +0100 Subject: [PATCH] bitswap: make use of default broadcast delay on initialization --- bitswap/client/client.go | 2 +- bitswap/internal/defaults/defaults.go | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/bitswap/client/client.go b/bitswap/client/client.go index f1308793d..aa9ab78fa 100644 --- a/bitswap/client/client.go +++ b/bitswap/client/client.go @@ -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, } diff --git a/bitswap/internal/defaults/defaults.go b/bitswap/internal/defaults/defaults.go index c7ac566f5..f5511cc7a 100644 --- a/bitswap/internal/defaults/defaults.go +++ b/bitswap/internal/defaults/defaults.go @@ -3,8 +3,6 @@ package defaults import ( "encoding/binary" "time" - - delay "github.com/ipfs/go-ipfs-delay" ) const ( @@ -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 )