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
43054ff0
Commit
43054ff0
authored
May 31, 2017
by
zramsay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address PR comments; remove commented/dead code
License: MIT Signed-off-by:
Zach Ramsay
<
zach.ramsay@gmail.com
>
parent
a1530f84
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
20 deletions
+4
-20
bitswap.go
bitswap.go
+2
-3
bitswap_test.go
bitswap_test.go
+2
-2
decision/ledger.go
decision/ledger.go
+0
-3
testutils.go
testutils.go
+0
-2
wantmanager.go
wantmanager.go
+0
-10
No files found.
bitswap.go
View file @
43054ff0
...
...
@@ -37,9 +37,8 @@ const (
// TODO: if a 'non-nice' strategy is implemented, consider increasing this value
maxProvidersPerRequest
=
3
providerRequestTimeout
=
time
.
Second
*
10
// hasBlockTimeout = time.Second * 15
provideTimeout
=
time
.
Second
*
15
sizeBatchRequestChan
=
32
provideTimeout
=
time
.
Second
*
15
sizeBatchRequestChan
=
32
// kMaxPriority is the max priority as defined by the bitswap protocol
kMaxPriority
=
math
.
MaxInt32
)
...
...
bitswap_test.go
View file @
43054ff0
...
...
@@ -601,14 +601,14 @@ func TestBitswapLedgerTwoWay(t *testing.T) {
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
time
.
Second
*
5
)
defer
cancel
()
blk
,
err
:
=
instances
[
1
]
.
Exchange
.
GetBlock
(
ctx
,
blocks
[
0
]
.
Cid
())
_
,
err
=
instances
[
1
]
.
Exchange
.
GetBlock
(
ctx
,
blocks
[
0
]
.
Cid
())
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
time
.
Second
*
5
)
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
{
t
.
Fatal
(
err
)
}
...
...
decision/ledger.go
View file @
43054ff0
...
...
@@ -27,9 +27,6 @@ type ledger struct {
// Accounting tracks bytes sent and recieved.
Accounting
debtRatio
// firstExchnage is the time of the first data exchange.
firstExchange
time
.
Time
// lastExchange is the time of the last data exchange.
lastExchange
time
.
Time
...
...
testutils.go
View file @
43054ff0
...
...
@@ -88,8 +88,6 @@ func (i *Instance) SetBlockstoreLatency(t time.Duration) time.Duration {
// just a much better idea.
func
Session
(
ctx
context
.
Context
,
net
tn
.
Network
,
p
testutil
.
Identity
)
Instance
{
bsdelay
:=
delay
.
Fixed
(
0
)
// const bloomSize = 512
// const writeCacheElems = 100
adapter
:=
net
.
Adapter
(
p
)
dstore
:=
ds_sync
.
MutexWrap
(
datastore2
.
WithDelay
(
ds
.
NewMapDatastore
(),
bsdelay
))
...
...
wantmanager.go
View file @
43054ff0
...
...
@@ -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
{
p
peer
.
ID
...
...
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