refac(bitswap) privatize send block
Brian Tiger Chow committed
Sep 17, 2014 at 03:00 UTC
cff3a86622ea6db1e8e30a172b9d0e337f1e7c90
1 file changed
+3
-3
bitswap/bitswap.go
+3
-3
@@ -139,7 +139,7 @@ func (bs *bitswap) HasBlock(blk blocks.Block) error {
139
if ledger.WantListContains(blk.Key()) {
140
//send block to node
141
if ledger.ShouldSend() {
142
- bs.SendBlock(ledger.Partner, blk)
142
+ bs.sendBlock(ledger.Partner, blk)
143
}
144
}
145
}
@@ -148,7 +148,7 @@ func (bs *bitswap) HasBlock(blk blocks.Block) error {
148
}
149
150
// TODO(brian): get a return value
151
-func (bs *bitswap) SendBlock(p *peer.Peer, b blocks.Block) {
151
+func (bs *bitswap) sendBlock(p *peer.Peer, b blocks.Block) {
152
u.DOut("Sending block to peer.\n")
153
message := bsmsg.New()
154
// TODO(brian): change interface to accept value instead of pointer
@@ -172,7 +172,7 @@ func (bs *bitswap) peerWantsBlock(p *peer.Peer, wanted u.Key) {
172
ledger.Wants(wanted)
173
return
174
}
175
- bs.SendBlock(p, *block)
175
+ bs.sendBlock(p, *block)
176
ledger.SentBytes(numBytes(*block))
177
}
178