Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
af8c7b4a
Commit
af8c7b4a
authored
Apr 25, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remove dead code
parent
131b9df7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
29 deletions
+1
-29
bitswap.go
bitswap.go
+1
-14
peermanager/peermanager.go
peermanager/peermanager.go
+0
-11
sessionpeermanager/sessionpeermanager.go
sessionpeermanager/sessionpeermanager.go
+0
-4
No files found.
bitswap.go
View file @
af8c7b4a
...
...
@@ -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
)
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
)
{
...
...
peermanager/peermanager.go
View file @
af8c7b4a
...
...
@@ -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
...
...
sessionpeermanager/sessionpeermanager.go
View file @
af8c7b4a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment