From fda94d9f346996dd8b48663b9f0b3ecf2385c9cc Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Mon, 15 Sep 2014 08:09:22 -0700 Subject: [PATCH] refactor(bitswap) rm SetStrategy method remove this setter while the interface is under construction --- bitswap/bitswap.go | 8 +------- core/core.go | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/bitswap/bitswap.go b/bitswap/bitswap.go index f0df93680..db4c3cdab 100644 --- a/bitswap/bitswap.go +++ b/bitswap/bitswap.go @@ -78,6 +78,7 @@ func NewSession(parent context.Context, p *peer.Peer, d ds.Datastore, r routing. sender: sender, haltChan: make(chan struct{}), notifications: notifications.New(), + strategy: YesManStrategy, } receiver.Delegate(bs) @@ -242,13 +243,6 @@ func (bs *BitSwap) Halt() { bs.haltChan <- struct{}{} } -func (bs *BitSwap) SetStrategy(sf StrategyFunc) { - bs.strategy = sf - for _, ledger := range bs.partners { - ledger.Strategy = sf - } -} - func (bs *BitSwap) ReceiveMessage( ctx context.Context, sender *peer.Peer, incoming bsmsg.BitSwapMessage) ( bsmsg.BitSwapMessage, *peer.Peer, error) { diff --git a/core/core.go b/core/core.go index e819a0bca..d9ea290e1 100644 --- a/core/core.go +++ b/core/core.go @@ -109,7 +109,6 @@ func NewIpfsNode(cfg *config.Config, online bool) (*IpfsNode, error) { // TODO(brian): pass a context to bs for its async operations bitswapSession := bitswap.NewSession(context.TODO(), local, d, route) - bitswapSession.SetStrategy(bitswap.YesManStrategy) // TODO(brian): pass a context to initConnections go initConnections(cfg, route)