diff --git a/examples/directchat.nim b/examples/directchat.nim index 2ffed90..eddc2a4 100644 --- a/examples/directchat.nim +++ b/examples/directchat.nim @@ -63,7 +63,7 @@ proc readAndPrint(p: ChatProto) {.async, gcsafe.} = proc dialPeer(p: ChatProto, address: string) {.async, gcsafe.} = var parts = address.split("/") - if parts.len == 11 and parts[^2] != "ipfs" and parts[^2] != "p2p": + if parts.len == 11 and parts[^2] notin ["ipfs", "p2p"]: quit("invalid or incompelete peerId") var remotePeer: PeerInfo diff --git a/libp2p/wire.nim b/libp2p/wire.nim index 7c4a325..511286a 100644 --- a/libp2p/wire.nim +++ b/libp2p/wire.nim @@ -142,7 +142,7 @@ proc getLocalAddress*(sock: AsyncFD): TransportAddress = fromSAddr(addr saddr, slen, result) proc toMultiAddr*(address: TransportAddress): MultiAddress = - ## Returns string representation of ``address``. + ## Returns a multiaddr of ``address``. case address.family of AddressFamily.IPv4: var a = IpAddress(