Skip to content

Commit

Permalink
Remove ConnManager from Upgrade (#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
Menduist committed Oct 13, 2023
1 parent 18b0f72 commit 60f9536
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libp2p/builders.nim
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ proc build*(b: SwitchBuilder): Switch
identify = Identify.new(peerInfo, b.sendSignedPeerRecord)
connManager = ConnManager.new(b.maxConnsPerPeer, b.maxConnections, b.maxIn, b.maxOut)
ms = MultistreamSelect.new()
muxedUpgrade = MuxedUpgrade.new(b.muxers, secureManagerInstances, connManager, ms)
muxedUpgrade = MuxedUpgrade.new(b.muxers, secureManagerInstances, ms)

let
transports = block:
Expand Down
2 changes: 0 additions & 2 deletions libp2p/upgrademngrs/muxedupgrade.nim
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,11 @@ proc new*(
T: type MuxedUpgrade,
muxers: seq[MuxerProvider],
secureManagers: openArray[Secure] = [],
connManager: ConnManager,
ms: MultistreamSelect): T =

let upgrader = T(
muxers: muxers,
secureManagers: @secureManagers,
connManager: connManager,
ms: ms)

upgrader.streamHandler = proc(conn: Connection)
Expand Down
1 change: 0 additions & 1 deletion libp2p/upgrademngrs/upgrade.nim
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ type

Upgrade* = ref object of RootObj
ms*: MultistreamSelect
connManager*: ConnManager
secureManagers*: seq[Secure]

method upgrade*(
Expand Down
2 changes: 1 addition & 1 deletion tests/testnoise.nim
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ proc createSwitch(ma: MultiAddress; outgoing: bool, secio: bool = false): (Switc
[Secure(Noise.new(rng, privateKey, outgoing = outgoing))]
connManager = ConnManager.new()
ms = MultistreamSelect.new()
muxedUpgrade = MuxedUpgrade.new(muxers, secureManagers, connManager, ms)
muxedUpgrade = MuxedUpgrade.new(muxers, secureManagers, ms)
transports = @[Transport(TcpTransport.new(upgrade = muxedUpgrade))]

let switch = newSwitch(
Expand Down

0 comments on commit 60f9536

Please sign in to comment.