Commit af8c7b4a authored by Steven Allen's avatar Steven Allen

chore: remove dead code

parent 131b9df7
...@@ -38,16 +38,8 @@ var log = logging.Logger("bitswap") ...@@ -38,16 +38,8 @@ var log = logging.Logger("bitswap")
var _ exchange.SessionExchange = (*Bitswap)(nil) var _ exchange.SessionExchange = (*Bitswap)(nil)
const ( const (
// maxProvidersPerRequest specifies the maximum number of providers desired
// from the network. This value is specified because the network streams
// results.
// TODO: if a 'non-nice' strategy is implemented, consider increasing this value
maxProvidersPerRequest = 3
findProviderDelay = 1 * time.Second
providerRequestTimeout = time.Second * 10
// these requests take at _least_ two minutes at the moment. // these requests take at _least_ two minutes at the moment.
provideTimeout = time.Minute * 3 provideTimeout = time.Minute * 3
sizeBatchRequestChan = 32
) )
var ( var (
...@@ -190,11 +182,6 @@ type counters struct { ...@@ -190,11 +182,6 @@ type counters struct {
messagesRecvd uint64 messagesRecvd uint64
} }
type blockRequest struct {
Cid cid.Cid
Ctx context.Context
}
// GetBlock attempts to retrieve a particular block from peers within the // GetBlock attempts to retrieve a particular block from peers within the
// deadline enforced by the context. // deadline enforced by the context.
func (bs *Bitswap) GetBlock(parent context.Context, k cid.Cid) (blocks.Block, error) { func (bs *Bitswap) GetBlock(parent context.Context, k cid.Cid) (blocks.Block, error) {
......
...@@ -5,17 +5,10 @@ import ( ...@@ -5,17 +5,10 @@ import (
bsmsg "github.com/ipfs/go-bitswap/message" bsmsg "github.com/ipfs/go-bitswap/message"
wantlist "github.com/ipfs/go-bitswap/wantlist" wantlist "github.com/ipfs/go-bitswap/wantlist"
logging "github.com/ipfs/go-log"
peer "github.com/libp2p/go-libp2p-peer" peer "github.com/libp2p/go-libp2p-peer"
) )
var log = logging.Logger("bitswap")
var (
metricsBuckets = []float64{1 << 6, 1 << 10, 1 << 14, 1 << 18, 1<<18 + 15, 1 << 22}
)
// PeerQueue provides a queer of messages to be sent for a single peer. // PeerQueue provides a queer of messages to be sent for a single peer.
type PeerQueue interface { type PeerQueue interface {
AddMessage(entries []bsmsg.Entry, ses uint64) AddMessage(entries []bsmsg.Entry, ses uint64)
...@@ -27,10 +20,6 @@ type PeerQueue interface { ...@@ -27,10 +20,6 @@ type PeerQueue interface {
// PeerQueueFactory provides a function that will create a PeerQueue. // PeerQueueFactory provides a function that will create a PeerQueue.
type PeerQueueFactory func(ctx context.Context, p peer.ID) PeerQueue type PeerQueueFactory func(ctx context.Context, p peer.ID) PeerQueue
type peerMessage interface {
handle(pm *PeerManager)
}
type peerQueueInstance struct { type peerQueueInstance struct {
refcnt int refcnt int
pq PeerQueue pq PeerQueue
......
...@@ -5,14 +5,10 @@ import ( ...@@ -5,14 +5,10 @@ import (
"fmt" "fmt"
"math/rand" "math/rand"
logging "github.com/ipfs/go-log"
cid "github.com/ipfs/go-cid" cid "github.com/ipfs/go-cid"
peer "github.com/libp2p/go-libp2p-peer" peer "github.com/libp2p/go-libp2p-peer"
) )
var log = logging.Logger("bitswap")
const ( const (
maxOptimizedPeers = 32 maxOptimizedPeers = 32
reservePeers = 2 reservePeers = 2
......
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