bitswap: add few method comments
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
Jul 7, 2017 at 20:54 UTC
dd7589bdafde48b1cb10b8f813e72eb43a217cb6
2 files changed
+3
blockservice/blockservice.go
+2
@@ -78,6 +78,8 @@ func (bs *blockService) Exchange() exchange.Interface {
78
return bs.exchange
79
}
80
81
+// NewSession creates a bitswap session that allows for controlled exchange of
82
+// wantlists to decrease the bandwidth overhead.
83
func NewSession(ctx context.Context, bs BlockService) *Session {
84
exchange := bs.Exchange()
85
if bswap, ok := exchange.(*bitswap.Bitswap); ok {
exchange/bitswap/wantlist/wantlist.go
+1
@@ -79,6 +79,7 @@ func (w *ThreadSafe) Add(c *cid.Cid, priority int, ses uint64) bool {
79
return true
80
}
81
82
+// AddEntry adds given Entry to the wantlist. For more information see Add method.
83
func (w *ThreadSafe) AddEntry(e *Entry, ses uint64) bool {
84
w.lk.Lock()
85
defer w.lk.Unlock()