@cryptotaxi247 / kubo / commits / 830883722

chore(bitswap) remove dead/unused wantlist code

Brian Tiger Chow committed Sep 17, 2014 at 02:25 UTC 830883722d9501b6d089937309fc9bf101c149de
1 file changed -18
bitswap/bitswap.go
-18
@@ -52,9 +52,6 @@ type bitswap struct {
52 // haveList is the set of keys we have values for. a map for fast lookups.
53 // haveList KeySet -- not needed. all values in datastore?
54
55 - // wantList is the set of keys we want values for. a map for fast lookups.
56 - wantList KeySet
57 -
55 strategy strategyFunc
56
57 haltChan chan struct{}
@@ -68,7 +65,6 @@ func NewSession(parent context.Context, s bsnet.NetworkService, p *peer.Peer, d
65 peer: p,
66 blockstore: blockstore.NewBlockstore(d),
67 partners: ledgerMap{},
71 - wantList: KeySet{},
68 routing: directory,
69 sender: bsnet.NewNetworkAdapter(s, &receiver),
70 haltChan: make(chan struct{}),
@@ -208,20 +204,6 @@ func (bs *bitswap) getLedger(p *peer.Peer) *ledger {
204 return l
205 }
206
211 -func (bs *bitswap) SendWantList(wl KeySet) error {
212 - message := bsmsg.New()
213 - for k, _ := range wl {
214 - message.AppendWanted(k)
215 - }
216 -
217 - // Lets just ping everybody all at once
218 - for _, ledger := range bs.partners {
219 - bs.sender.SendMessage(context.TODO(), ledger.Partner, message)
220 - }
221 -
222 - return nil
223 -}
224 -
207 func (bs *bitswap) Halt() {
208 bs.haltChan <- struct{}{}
209 }