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")
var _ exchange.SessionExchange = (*Bitswap)(nil)
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.
provideTimeout = time.Minute * 3
sizeBatchRequestChan = 32
provideTimeout = time.Minute * 3
)
var (
......@@ -190,11 +182,6 @@ type counters struct {
messagesRecvd uint64
}
type blockRequest struct {
Cid cid.Cid
Ctx context.Context
}
// GetBlock attempts to retrieve a particular block from peers within the
// deadline enforced by the context.
func (bs *Bitswap) GetBlock(parent context.Context, k cid.Cid) (blocks.Block, error) {
......
......@@ -5,17 +5,10 @@ import (
bsmsg "github.com/ipfs/go-bitswap/message"
wantlist "github.com/ipfs/go-bitswap/wantlist"
logging "github.com/ipfs/go-log"
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.
type PeerQueue interface {
AddMessage(entries []bsmsg.Entry, ses uint64)
......@@ -27,10 +20,6 @@ type PeerQueue interface {
// PeerQueueFactory provides a function that will create a PeerQueue.
type PeerQueueFactory func(ctx context.Context, p peer.ID) PeerQueue
type peerMessage interface {
handle(pm *PeerManager)
}
type peerQueueInstance struct {
refcnt int
pq PeerQueue
......
......@@ -5,14 +5,10 @@ import (
"fmt"
"math/rand"
logging "github.com/ipfs/go-log"
cid "github.com/ipfs/go-cid"
peer "github.com/libp2p/go-libp2p-peer"
)
var log = logging.Logger("bitswap")
const (
maxOptimizedPeers = 32
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