Commit 43054ff0 authored by zramsay's avatar zramsay

address PR comments; remove commented/dead code

License: MIT
Signed-off-by: default avatarZach Ramsay <zach.ramsay@gmail.com>
parent a1530f84
...@@ -37,9 +37,8 @@ const ( ...@@ -37,9 +37,8 @@ const (
// TODO: if a 'non-nice' strategy is implemented, consider increasing this value // TODO: if a 'non-nice' strategy is implemented, consider increasing this value
maxProvidersPerRequest = 3 maxProvidersPerRequest = 3
providerRequestTimeout = time.Second * 10 providerRequestTimeout = time.Second * 10
// hasBlockTimeout = time.Second * 15 provideTimeout = time.Second * 15
provideTimeout = time.Second * 15 sizeBatchRequestChan = 32
sizeBatchRequestChan = 32
// kMaxPriority is the max priority as defined by the bitswap protocol // kMaxPriority is the max priority as defined by the bitswap protocol
kMaxPriority = math.MaxInt32 kMaxPriority = math.MaxInt32
) )
......
...@@ -601,14 +601,14 @@ func TestBitswapLedgerTwoWay(t *testing.T) { ...@@ -601,14 +601,14 @@ func TestBitswapLedgerTwoWay(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel() defer cancel()
blk, err := instances[1].Exchange.GetBlock(ctx, blocks[0].Cid()) _, err = instances[1].Exchange.GetBlock(ctx, blocks[0].Cid())
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
ctx, cancel = context.WithTimeout(context.Background(), time.Second*5) ctx, cancel = context.WithTimeout(context.Background(), time.Second*5)
defer cancel() defer cancel()
blk, err = instances[0].Exchange.GetBlock(ctx, blocks[1].Cid()) blk, err := instances[0].Exchange.GetBlock(ctx, blocks[1].Cid())
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
...@@ -27,9 +27,6 @@ type ledger struct { ...@@ -27,9 +27,6 @@ type ledger struct {
// Accounting tracks bytes sent and recieved. // Accounting tracks bytes sent and recieved.
Accounting debtRatio Accounting debtRatio
// firstExchnage is the time of the first data exchange.
firstExchange time.Time
// lastExchange is the time of the last data exchange. // lastExchange is the time of the last data exchange.
lastExchange time.Time lastExchange time.Time
......
...@@ -88,8 +88,6 @@ func (i *Instance) SetBlockstoreLatency(t time.Duration) time.Duration { ...@@ -88,8 +88,6 @@ func (i *Instance) SetBlockstoreLatency(t time.Duration) time.Duration {
// just a much better idea. // just a much better idea.
func Session(ctx context.Context, net tn.Network, p testutil.Identity) Instance { func Session(ctx context.Context, net tn.Network, p testutil.Identity) Instance {
bsdelay := delay.Fixed(0) bsdelay := delay.Fixed(0)
// const bloomSize = 512
// const writeCacheElems = 100
adapter := net.Adapter(p) adapter := net.Adapter(p)
dstore := ds_sync.MutexWrap(datastore2.WithDelay(ds.NewMapDatastore(), bsdelay)) dstore := ds_sync.MutexWrap(datastore2.WithDelay(ds.NewMapDatastore(), bsdelay))
......
...@@ -55,16 +55,6 @@ func NewWantManager(ctx context.Context, network bsnet.BitSwapNetwork) *WantMana ...@@ -55,16 +55,6 @@ func NewWantManager(ctx context.Context, network bsnet.BitSwapNetwork) *WantMana
} }
} }
/*type msgPair struct {
to peer.ID
msg bsmsg.BitSwapMessage
}
type cancellation struct {
who peer.ID
blk *cid.Cid
}*/
type msgQueue struct { type msgQueue struct {
p peer.ID p peer.ID
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment