commit 2638c818e95af3253a9c780ccf74b2c157333709
parent 2904615211848698f52768f17ba0fea5e635c732
Author: ThomasV <thomasv@electrum.org>
Date: Thu, 26 Nov 2020 12:07:03 +0100
fix #6757: truncate invoice description to 639 bytes
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/electrum/lnaddr.py b/electrum/lnaddr.py
@@ -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)