Bugfix: Fix an empty name field in the ETH/LES protocol info

This commit is contained in:
Zahary Karadjov 2019-06-05 16:09:06 +03:00
parent bac87ff6d2
commit 9191bc7851
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 2 additions and 3 deletions

View File

@ -576,11 +576,10 @@ proc p2pProtocolBackendImpl*(protocol: P2PProtocol): Backend =
ResponderWithoutId = bindSym "ResponderWithoutId"
isSubprotocol = protocol.version > 0
shortName = if protocol.shortName.len > 0: protocol.shortName
else: protocol.name
if protocol.shortName.len == 0: protocol.shortName = protocol.name
# By convention, all Ethereum protocol names must be abbreviated to 3 letters
doAssert shortName.len == 3
doAssert protocol.shortName.len == 3
new result