mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2026-01-08 21:58:04 -05:00
Fixes and tweaks related to the beacon node integration
* Bugfix: Dialing an already connected peer may lead to crash * Introduced a standard_setup module allowing to instantiate the `Switch` object in an easier manner. * Added `Switch.disconnect(peer)` * Trailing space removed (sorry about polluting the diff)
This commit is contained in:
@@ -126,8 +126,8 @@ proc createSwitch(ma: MultiAddress): (Switch, PeerInfo) =
|
||||
|
||||
let mplexProvider = newMuxerProvider(createMplex, MplexCodec) # create multiplexer
|
||||
let transports = @[Transport(newTransport(TcpTransport))] # add all transports (tcp only for now, but can be anything in the future)
|
||||
let muxers = [(MplexCodec, mplexProvider)].toTable() # add all muxers
|
||||
let secureManagers = [(SecioCodec, Secure(newSecio(seckey)))].toTable() # setup the secio and any other secure provider
|
||||
let muxers = {MplexCodec: mplexProvider}.toTable() # add all muxers
|
||||
let secureManagers = {SecioCodec: Secure(newSecio(seckey))}.toTable() # setup the secio and any other secure provider
|
||||
|
||||
# create the switch
|
||||
let switch = newSwitch(peerInfo,
|
||||
|
||||
Reference in New Issue
Block a user