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
dfb0a9c6
Commit
dfb0a9c6
authored
Oct 27, 2014
by
Brian Tiger Chow
Committed by
Juan Batiz-Benet
Nov 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(core, bitswap) split bitswap init into two steps
@jbenet
parent
c5333a20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
bitswap.go
bitswap.go
+5
-7
No files found.
bitswap.go
View file @
dfb0a9c6
...
@@ -15,18 +15,18 @@ import (
...
@@ -15,18 +15,18 @@ import (
bsnet
"github.com/jbenet/go-ipfs/exchange/bitswap/network"
bsnet
"github.com/jbenet/go-ipfs/exchange/bitswap/network"
notifications
"github.com/jbenet/go-ipfs/exchange/bitswap/notifications"
notifications
"github.com/jbenet/go-ipfs/exchange/bitswap/notifications"
strategy
"github.com/jbenet/go-ipfs/exchange/bitswap/strategy"
strategy
"github.com/jbenet/go-ipfs/exchange/bitswap/strategy"
inet
"github.com/jbenet/go-ipfs/net"
peer
"github.com/jbenet/go-ipfs/peer"
peer
"github.com/jbenet/go-ipfs/peer"
u
"github.com/jbenet/go-ipfs/util"
u
"github.com/jbenet/go-ipfs/util"
)
)
var
log
=
u
.
Logger
(
"bitswap"
)
var
log
=
u
.
Logger
(
"bitswap"
)
// NetMessageSession initializes a BitSwap session that communicates over the
// New initializes a BitSwap instance that communicates over the
// provided NetMessage service.
// provided BitSwapNetwork. This function registers the returned instance as
// the network delegate.
// Runs until context is cancelled
// Runs until context is cancelled
func
Ne
tMessageSession
(
ctx
context
.
Context
,
p
peer
.
Peer
,
func
Ne
w
(
ctx
context
.
Context
,
p
peer
.
Peer
,
net
inet
.
Network
,
srv
inet
.
Service
,
routing
bsnet
.
Routing
,
net
work
bsnet
.
BitSwapNetwork
,
routing
bsnet
.
Routing
,
d
ds
.
ThreadSafeDatastore
,
nice
bool
)
exchange
.
Interface
{
d
ds
.
ThreadSafeDatastore
,
nice
bool
)
exchange
.
Interface
{
notif
:=
notifications
.
New
()
notif
:=
notifications
.
New
()
...
@@ -37,8 +37,6 @@ func NetMessageSession(ctx context.Context, p peer.Peer,
...
@@ -37,8 +37,6 @@ func NetMessageSession(ctx context.Context, p peer.Peer,
}
}
}()
}()
network
:=
bsnet
.
NewFromIpfsNetwork
(
srv
,
net
)
bs
:=
&
bitswap
{
bs
:=
&
bitswap
{
blockstore
:
blockstore
.
NewBlockstore
(
d
),
blockstore
:
blockstore
.
NewBlockstore
(
d
),
notifications
:
notif
,
notifications
:
notif
,
...
...
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