tfix #6757: truncate invoice description to 639 bytes - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 2638c818e95af3253a9c780ccf74b2c157333709 DIR parent 2904615211848698f52768f17ba0fea5e635c732 HTML Author: ThomasV <thomasv@electrum.org> Date: Thu, 26 Nov 2020 12:07:03 +0100 fix #6757: truncate invoice description to 639 bytes Diffstat: M electrum/lnaddr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- DIR diff --git a/electrum/lnaddr.py b/electrum/lnaddr.py t@@ -217,7 +217,8 @@ def lnencode(addr: 'LnAddr', privkey) -> str: elif k == 'f': data += encode_fallback(v, addr.currency) elif k == 'd': - data += tagged_bytes('d', v.encode()) + # truncate to max length: 1024*5 bits = 639 bytes + data += tagged_bytes('d', v.encode()[0:639]) elif k == 'x': expirybits = bitstring.pack('intbe:64', v) expirybits = trim_to_min_length(expirybits)