From f1a297f0f3a400e172c966a8929dd2d3d80cdbe0 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 24 Feb 2020 23:25:56 -0600 Subject: [PATCH] add initiator flag to handshake --- libp2p/protocols/secure/secio.nim | 2 +- libp2p/protocols/secure/secure.nim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libp2p/protocols/secure/secio.nim b/libp2p/protocols/secure/secio.nim index cbb44193a..61e6ef64e 100644 --- a/libp2p/protocols/secure/secio.nim +++ b/libp2p/protocols/secure/secio.nim @@ -281,7 +281,7 @@ proc transactMessage(conn: Connection, except AsyncStreamWriteError: trace "Could not write to connection", conn = $conn -method handshake*(s: Secio, conn: Connection): Future[SecureConn] {.async.} = +method handshake*(s: Secio, conn: Connection, initiator: bool = false): Future[SecureConn] {.async.} = var localNonce: array[SecioNonceSize, byte] remoteNonce: seq[byte] diff --git a/libp2p/protocols/secure/secure.nim b/libp2p/protocols/secure/secure.nim index a030f399c..fb8c8e298 100644 --- a/libp2p/protocols/secure/secure.nim +++ b/libp2p/protocols/secure/secure.nim @@ -20,7 +20,7 @@ import secureconn, type Secure* = ref object of LPProtocol # base type for secure managers -method handshake(s: Secure, conn: Connection): Future[SecureConn] {.async, base.} = +method handshake(s: Secure, conn: Connection, initiator: bool = true): Future[SecureConn] {.async, base.} = doAssert(false, "Not implemented!") proc readLoop(sconn: SecureConn, stream: BufferStream) {.async.} =