mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 09:59:13 +08:00
chore(bitswap) cleanup
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package bitswap
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"math/rand"
|
||||
"sync"
|
||||
|
||||
@ -12,13 +11,10 @@ import (
|
||||
)
|
||||
|
||||
type RoutingServer interface {
|
||||
// TODO
|
||||
Announce(*peer.Peer, u.Key) error
|
||||
|
||||
// TODO
|
||||
Providers(u.Key) []*peer.Peer
|
||||
|
||||
// TODO
|
||||
// Returns a Routing instance configured to query this hash table
|
||||
Client(*peer.Peer) bsnet.Routing
|
||||
}
|
||||
@ -34,8 +30,6 @@ type hashTable struct {
|
||||
providers map[u.Key]peer.Map
|
||||
}
|
||||
|
||||
var TODO = errors.New("TODO")
|
||||
|
||||
func (rs *hashTable) Announce(p *peer.Peer, k u.Key) error {
|
||||
rs.lock.Lock()
|
||||
defer rs.lock.Unlock()
|
||||
@ -68,7 +62,6 @@ func (rs *hashTable) Providers(k u.Key) []*peer.Peer {
|
||||
return ret
|
||||
}
|
||||
|
||||
// TODO
|
||||
func (rs *hashTable) Client(p *peer.Peer) bsnet.Routing {
|
||||
return &routingClient{
|
||||
peer: p,
|
||||
|
Reference in New Issue
Block a user