@cryptotaxi247 / kubo / commits / fda94d9f3

refactor(bitswap) rm SetStrategy method

remove this setter while the interface is under construction

Brian Tiger Chow committed Sep 15, 2014 at 08:09 UTC fda94d9f346996dd8b48663b9f0b3ecf2385c9cc
2 files changed +1 -8
bitswap/bitswap.go
+1 -7
@@ -78,6 +78,7 @@ func NewSession(parent context.Context, p *peer.Peer, d ds.Datastore, r routing.
78 sender: sender,
79 haltChan: make(chan struct{}),
80 notifications: notifications.New(),
81 + strategy: YesManStrategy,
82 }
83 receiver.Delegate(bs)
84
@@ -242,13 +243,6 @@ func (bs *BitSwap) Halt() {
243 bs.haltChan <- struct{}{}
244 }
245
245 -func (bs *BitSwap) SetStrategy(sf StrategyFunc) {
246 - bs.strategy = sf
247 - for _, ledger := range bs.partners {
248 - ledger.Strategy = sf
249 - }
250 -}
251 -
246 func (bs *BitSwap) ReceiveMessage(
247 ctx context.Context, sender *peer.Peer, incoming bsmsg.BitSwapMessage) (
248 bsmsg.BitSwapMessage, *peer.Peer, error) {
core/core.go
-1
@@ -109,7 +109,6 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) {
109
110 // TODO(brian): pass a context to bs for its async operations
111 bitswapSession := bitswap.NewSession(context.TODO(), local, d, route)
112 - bitswapSession.SetStrategy(bitswap.YesManStrategy)
112
113 // TODO(brian): pass a context to initConnections
114 go initConnections(cfg, route)