Commit 7d62be76 authored by Brian Tiger Chow's avatar Brian Tiger Chow

chore(bitswap) cleanup

parent 60798b80
package bitswap package bitswap
import ( import (
"errors"
"math/rand" "math/rand"
"sync" "sync"
...@@ -12,13 +11,10 @@ import ( ...@@ -12,13 +11,10 @@ import (
) )
type RoutingServer interface { type RoutingServer interface {
// TODO
Announce(*peer.Peer, u.Key) error Announce(*peer.Peer, u.Key) error
// TODO
Providers(u.Key) []*peer.Peer Providers(u.Key) []*peer.Peer
// TODO
// Returns a Routing instance configured to query this hash table // Returns a Routing instance configured to query this hash table
Client(*peer.Peer) bsnet.Routing Client(*peer.Peer) bsnet.Routing
} }
...@@ -34,8 +30,6 @@ type hashTable struct { ...@@ -34,8 +30,6 @@ type hashTable struct {
providers map[u.Key]peer.Map providers map[u.Key]peer.Map
} }
var TODO = errors.New("TODO")
func (rs *hashTable) Announce(p *peer.Peer, k u.Key) error { func (rs *hashTable) Announce(p *peer.Peer, k u.Key) error {
rs.lock.Lock() rs.lock.Lock()
defer rs.lock.Unlock() defer rs.lock.Unlock()
...@@ -68,7 +62,6 @@ func (rs *hashTable) Providers(k u.Key) []*peer.Peer { ...@@ -68,7 +62,6 @@ func (rs *hashTable) Providers(k u.Key) []*peer.Peer {
return ret return ret
} }
// TODO
func (rs *hashTable) Client(p *peer.Peer) bsnet.Routing { func (rs *hashTable) Client(p *peer.Peer) bsnet.Routing {
return &routingClient{ return &routingClient{
peer: p, peer: p,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment