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-unixfs
Commits
fda94d9f
Commit
fda94d9f
authored
Sep 15, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(bitswap) rm SetStrategy method
remove this setter while the interface is under construction
parent
0ab86de4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
8 deletions
+1
-8
bitswap/bitswap.go
bitswap/bitswap.go
+1
-7
core/core.go
core/core.go
+0
-1
No files found.
bitswap/bitswap.go
View file @
fda94d9f
...
...
@@ -78,6 +78,7 @@ func NewSession(parent context.Context, p *peer.Peer, d ds.Datastore, r routing.
sender
:
sender
,
haltChan
:
make
(
chan
struct
{}),
notifications
:
notifications
.
New
(),
strategy
:
YesManStrategy
,
}
receiver
.
Delegate
(
bs
)
...
...
@@ -242,13 +243,6 @@ func (bs *BitSwap) Halt() {
bs
.
haltChan
<-
struct
{}{}
}
func
(
bs
*
BitSwap
)
SetStrategy
(
sf
StrategyFunc
)
{
bs
.
strategy
=
sf
for
_
,
ledger
:=
range
bs
.
partners
{
ledger
.
Strategy
=
sf
}
}
func
(
bs
*
BitSwap
)
ReceiveMessage
(
ctx
context
.
Context
,
sender
*
peer
.
Peer
,
incoming
bsmsg
.
BitSwapMessage
)
(
bsmsg
.
BitSwapMessage
,
*
peer
.
Peer
,
error
)
{
...
...
core/core.go
View file @
fda94d9f
...
...
@@ -109,7 +109,6 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
// TODO(brian): pass a context to bs for its async operations
bitswapSession
:=
bitswap
.
NewSession
(
context
.
TODO
(),
local
,
d
,
route
)
bitswapSession
.
SetStrategy
(
bitswap
.
YesManStrategy
)
// TODO(brian): pass a context to initConnections
go
initConnections
(
cfg
,
route
)
...
...
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