From cff3a86622ea6db1e8e30a172b9d0e337f1e7c90 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Wed, 17 Sep 2014 03:00:35 -0700 Subject: [PATCH] refac(bitswap) privatize send block --- bitswap/bitswap.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bitswap/bitswap.go b/bitswap/bitswap.go index c95d98ac9..7d128b878 100644 --- a/bitswap/bitswap.go +++ b/bitswap/bitswap.go @@ -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.SendBlock(ledger.Partner, blk) + bs.sendBlock(ledger.Partner, blk) } } } @@ -148,7 +148,7 @@ func (bs *bitswap) HasBlock(blk blocks.Block) error { } // TODO(brian): get a return value -func (bs *bitswap) SendBlock(p *peer.Peer, b blocks.Block) { +func (bs *bitswap) sendBlock(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.SendBlock(p, *block) + bs.sendBlock(p, *block) ledger.SentBytes(numBytes(*block)) }