mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-04 07:48:00 +08:00
bitswap: add few method comments
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
parent
3be5c913ee
commit
dd7589bdaf
@ -78,6 +78,8 @@ func (bs *blockService) Exchange() exchange.Interface {
|
||||
return bs.exchange
|
||||
}
|
||||
|
||||
// NewSession creates a bitswap session that allows for controlled exchange of
|
||||
// wantlists to decrease the bandwidth overhead.
|
||||
func NewSession(ctx context.Context, bs BlockService) *Session {
|
||||
exchange := bs.Exchange()
|
||||
if bswap, ok := exchange.(*bitswap.Bitswap); ok {
|
||||
|
||||
@ -79,6 +79,7 @@ func (w *ThreadSafe) Add(c *cid.Cid, priority int, ses uint64) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// AddEntry adds given Entry to the wantlist. For more information see Add method.
|
||||
func (w *ThreadSafe) AddEntry(e *Entry, ses uint64) bool {
|
||||
w.lk.Lock()
|
||||
defer w.lk.Unlock()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user