Commit 4c6a6012 authored by Brian Tiger Chow's avatar Brian Tiger Chow

fix(bitswap) remove peerstore

parent ca182aed
......@@ -18,7 +18,6 @@ func NewSessionGenerator(
net tn.Network) SessionGenerator {
ctx, cancel := context.WithCancel(context.TODO())
return SessionGenerator{
ps: peer.NewPeerstore(),
net: net,
seq: 0,
ctx: ctx, // TODO take ctx as param to Next, Instances
......@@ -30,7 +29,6 @@ func NewSessionGenerator(
type SessionGenerator struct {
seq int
net tn.Network
ps peer.Peerstore
ctx context.Context
cancel context.CancelFunc
}
......@@ -42,7 +40,7 @@ func (g *SessionGenerator) Close() error {
func (g *SessionGenerator) Next() Instance {
g.seq++
return session(g.ctx, g.net, g.ps, peer.ID(g.seq))
return session(g.ctx, g.net, peer.ID(g.seq))
}
func (g *SessionGenerator) Instances(n int) []Instance {
......@@ -75,7 +73,7 @@ func (i *Instance) SetBlockstoreLatency(t time.Duration) time.Duration {
// NB: It's easy make mistakes by providing the same peer ID to two different
// sessions. To safeguard, use the SessionGenerator to generate sessions. It's
// just a much better idea.
func session(ctx context.Context, net tn.Network, ps peer.Peerstore, p peer.ID) Instance {
func session(ctx context.Context, net tn.Network, p peer.ID) Instance {
adapter := net.Adapter(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