Browse Source

lnpeer: fix flen in INIT

patch-4
ThomasV 4 years ago
parent
commit
fe1b2149cb
  1. 8
      electrum/lnpeer.py

8
electrum/lnpeer.py

@ -133,8 +133,12 @@ class Peer(Logger):
async def initialize(self): async def initialize(self):
if isinstance(self.transport, LNTransport): if isinstance(self.transport, LNTransport):
await self.transport.handshake() await self.transport.handshake()
# FIXME: "flen" hardcoded but actually it depends on "features"...: features = self.features.for_init_message()
self.send_message("init", gflen=0, flen=2, features=self.features.for_init_message(), b = int.bit_length(features)
flen = b // 8 + int(bool(b % 8))
self.send_message(
"init", gflen=0, flen=flen,
features=features,
init_tlvs={ init_tlvs={
'networks': 'networks':
{'chains': constants.net.rev_genesis_bytes()} {'chains': constants.net.rev_genesis_bytes()}

Loading…
Cancel
Save