From abf659a01a654020018f0a94b958e444c08702b3 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 1 Jun 2020 11:49:25 -0600 Subject: [PATCH] more consistent dialing proto selecting logic --- libp2p/multistream.nim | 23 ++++++++++++----------- libp2p/switch.nim | 27 ++++++++++----------------- tests/testinterop.nim | 4 ---- 3 files changed, 22 insertions(+), 32 deletions(-) diff --git a/libp2p/multistream.nim b/libp2p/multistream.nim index 15fbe73..f9b0e0c 100644 --- a/libp2p/multistream.nim +++ b/libp2p/multistream.nim @@ -71,18 +71,19 @@ proc select*(m: MultistreamSelect, trace "reading first requested proto" result.removeSuffix("\n") if result == proto[0]: - trace "succesfully selected ", proto = proto + trace "successfully selected ", proto = proto return - if not result.len > 0: - trace "selecting one of several protos" - for p in proto[1..= count and not finished: finished = true @@ -108,7 +107,6 @@ proc testPubSubDaemonPublish(gossip: bool = false, await wait(publisher(), 5.minutes) # should be plenty of time - echo "HEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" result = true await nativeNode.stop() await allFutures(awaiters) @@ -144,7 +142,6 @@ proc testPubSubNodePublish(gossip: bool = false, let smsg = cast[string](message.data) check smsg == pubsubData times.inc() - echo "TIMES ", times if times >= count and not finished: finished = true result = true # don't cancel subscription @@ -356,7 +353,6 @@ suite "Interop": check line == test await conn.writeLp(cast[seq[byte]](test)) count.inc() - echo "COUNT ", count testFuture.complete(count) await conn.close()