Fix multistream select trace proto logging

This commit is contained in:
Giovanni Petrantoni 2020-06-16 12:02:47 +09:00
parent 9d9f793b4f
commit 0d81acafa8
1 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ proc select*(m: MultistreamSelect,
## select a remote protocol
await conn.write(m.codec) # write handshake
if proto.len() > 0:
trace "selecting proto", proto = proto
trace "selecting proto", proto = proto[0]
await conn.writeLp((proto[0] & "\n")) # select proto
result = string.fromBytes((await conn.readLp(1024))) # read ms header
@ -71,7 +71,7 @@ proc select*(m: MultistreamSelect,
trace "reading first requested proto"
result.removeSuffix("\n")
if result == proto[0]:
trace "successfully selected ", proto = proto
trace "successfully selected ", proto = proto[0]
return
let protos = proto[1..<proto.len()]