mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-08-24 23:11:12 +00:00
refactor: reuse nim-libp2p peerstore + move peermanager logic (#1383)
* refactor: reuse nim-libp2p peerstore + move peermanager logic * refactor: fix comments * refactor: modify reconnectPeers and unittest * feat(apps): new flag for peerStoreCapacity * fix(examples): fix example2 target * refactor: fix comments
This commit is contained in:
@@ -101,7 +101,7 @@ proc main(): Future[int] {.async.} =
|
||||
|
||||
# ensure input protocols are valid
|
||||
for p in conf.protocols:
|
||||
if p notin ProtocolsTable:
|
||||
if p notin ProtocolsTable:
|
||||
error "invalid protocol", protocol=p, valid=ProtocolsTable
|
||||
raise newException(ConfigurationError, "Invalid cli flag values" & p)
|
||||
|
||||
@@ -128,7 +128,7 @@ proc main(): Future[int] {.async.} =
|
||||
error "Timedout after", timeout=conf.timeout
|
||||
|
||||
let lp2pPeerStore = node.switch.peerStore
|
||||
let conStatus = node.peerManager.peerStore.connectionBook[peer.peerId]
|
||||
let conStatus = node.peerManager.peerStore[ConnectionBook][peer.peerId]
|
||||
|
||||
if conStatus in [Connected, CanConnect]:
|
||||
let nodeProtocols = lp2pPeerStore[ProtoBook][peer.peerId]
|
||||
|
||||
Reference in New Issue
Block a user