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
90324639
Commit
90324639
authored
Dec 23, 2014
by
Brian Tiger Chow
Committed by
Juan Batiz-Benet
Dec 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(bitswap) rename to network
parent
3468d94b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
bitswap.go
bitswap.go
+5
-5
No files found.
bitswap.go
View file @
90324639
...
...
@@ -64,7 +64,7 @@ func New(parent context.Context, p peer.ID, network bsnet.BitSwapNetwork, routin
notifications
:
notif
,
engine
:
decision
.
NewEngine
(
ctx
,
bstore
),
routing
:
routing
,
sender
:
network
,
network
:
network
,
wantlist
:
wantlist
.
NewThreadSafe
(),
batchRequests
:
make
(
chan
[]
u
.
Key
,
sizeBatchRequestChan
),
}
...
...
@@ -78,8 +78,8 @@ func New(parent context.Context, p peer.ID, network bsnet.BitSwapNetwork, routin
// bitswap instances implement the bitswap protocol.
type
bitswap
struct
{
//
sender
delivers messages on behalf of the session
sender
bsnet
.
BitSwapNetwork
//
network
delivers messages on behalf of the session
network
bsnet
.
BitSwapNetwork
// blockstore is the local database
// NB: ensure threadsafety
...
...
@@ -341,11 +341,11 @@ func (bs *bitswap) ReceiveError(err error) {
// sent
func
(
bs
*
bitswap
)
send
(
ctx
context
.
Context
,
p
peer
.
ID
,
m
bsmsg
.
BitSwapMessage
)
error
{
log
.
Event
(
ctx
,
"DialPeer"
,
p
)
err
:=
bs
.
sender
.
DialPeer
(
ctx
,
p
)
err
:=
bs
.
network
.
DialPeer
(
ctx
,
p
)
if
err
!=
nil
{
return
errors
.
Wrap
(
err
)
}
if
err
:=
bs
.
sender
.
SendMessage
(
ctx
,
p
,
m
);
err
!=
nil
{
if
err
:=
bs
.
network
.
SendMessage
(
ctx
,
p
,
m
);
err
!=
nil
{
return
errors
.
Wrap
(
err
)
}
return
bs
.
engine
.
MessageSent
(
p
,
m
)
...
...
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