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
a910d687
Commit
a910d687
authored
Sep 10, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
privatize getLedger method
parent
d71c1668
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 @
a910d687
...
...
@@ -192,7 +192,7 @@ func (bs *BitSwap) handleMessages() {
// and then if we do, check the ledger for whether or not we should send it.
func
(
bs
*
BitSwap
)
peerWantsBlock
(
p
*
peer
.
Peer
,
want
string
)
{
u
.
DOut
(
"peer [%s] wants block [%s]
\n
"
,
p
.
ID
.
Pretty
(),
u
.
Key
(
want
)
.
Pretty
())
ledg
:=
bs
.
G
etLedger
(
p
)
ledg
:=
bs
.
g
etLedger
(
p
)
dsk
:=
ds
.
NewKey
(
want
)
blk_i
,
err
:=
bs
.
datastore
.
Get
(
dsk
)
...
...
@@ -239,11 +239,11 @@ func (bs *BitSwap) blockReceive(p *peer.Peer, blk *blocks.Block) {
}
bs
.
listener
.
Respond
(
string
(
blk
.
Key
()),
mes
)
ledger
:=
bs
.
G
etLedger
(
p
)
ledger
:=
bs
.
g
etLedger
(
p
)
ledger
.
ReceivedBytes
(
len
(
blk
.
Data
))
}
func
(
bs
*
BitSwap
)
G
etLedger
(
p
*
peer
.
Peer
)
*
Ledger
{
func
(
bs
*
BitSwap
)
g
etLedger
(
p
*
peer
.
Peer
)
*
Ledger
{
l
,
ok
:=
bs
.
partners
[
p
.
Key
()]
if
ok
{
return
l
...
...
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