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-dms3
Commits
cff3a866
Commit
cff3a866
authored
Sep 17, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refac(bitswap) privatize send block
parent
83088372
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
bitswap/bitswap.go
bitswap/bitswap.go
+3
-3
No files found.
bitswap/bitswap.go
View file @
cff3a866
...
...
@@ -139,7 +139,7 @@ func (bs *bitswap) HasBlock(blk blocks.Block) error {
if
ledger
.
WantListContains
(
blk
.
Key
())
{
//send block to node
if
ledger
.
ShouldSend
()
{
bs
.
S
endBlock
(
ledger
.
Partner
,
blk
)
bs
.
s
endBlock
(
ledger
.
Partner
,
blk
)
}
}
}
...
...
@@ -148,7 +148,7 @@ func (bs *bitswap) HasBlock(blk blocks.Block) error {
}
// TODO(brian): get a return value
func
(
bs
*
bitswap
)
S
endBlock
(
p
*
peer
.
Peer
,
b
blocks
.
Block
)
{
func
(
bs
*
bitswap
)
s
endBlock
(
p
*
peer
.
Peer
,
b
blocks
.
Block
)
{
u
.
DOut
(
"Sending block to peer.
\n
"
)
message
:=
bsmsg
.
New
()
// TODO(brian): change interface to accept value instead of pointer
...
...
@@ -172,7 +172,7 @@ func (bs *bitswap) peerWantsBlock(p *peer.Peer, wanted u.Key) {
ledger
.
Wants
(
wanted
)
return
}
bs
.
S
endBlock
(
p
,
*
block
)
bs
.
s
endBlock
(
p
,
*
block
)
ledger
.
SentBytes
(
numBytes
(
*
block
))
}
...
...
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