diff --git a/libp2p/multiaddress.nim b/libp2p/multiaddress.nim index 3754a47..e313fba 100644 --- a/libp2p/multiaddress.nim +++ b/libp2p/multiaddress.nim @@ -856,7 +856,7 @@ proc init*(mtype: typedesc[MultiAddress], address: ValidIpAddress, of IpAddressFamily.IPv4: res.data.writeArray(address.address_v4) of IpAddressFamily.IPv6: res.data.writeArray(address.address_v6) res.data.write(transportProto.mcodec) - res.data.write(toBytesBE(uint16(port))) + res.data.writeArray(toBytesBE(uint16(port))) res.data.finish() ok(res)