From 512c85592fa98655decdd266ca1d4c13864d16ff Mon Sep 17 00:00:00 2001 From: jackstar12 <62219658+jackstar12@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:32:56 +0200 Subject: [PATCH] fix(boltz): sanitize invoice description (#2731) Boltz rejects nbsp char (produced by JS Intl.NumberFormat api), so simply replace it with normal space --- lnbits/wallets/boltz.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lnbits/wallets/boltz.py b/lnbits/wallets/boltz.py index ab90a6612..d4eb16de4 100644 --- a/lnbits/wallets/boltz.py +++ b/lnbits/wallets/boltz.py @@ -95,8 +95,10 @@ class BoltzWallet(Wallet): wallet_id=self.wallet_id, accept_zero_conf=True, external_pay=True, - description=memo, ) + if memo is not None: + # boltz rejects nbsp char (produced by JS Intl.NumberFormat api) + request.description = memo.replace("\xa0", " ") response: boltzrpc_pb2.CreateReverseSwapResponse try: response = await self.rpc.CreateReverseSwap(request, metadata=self.metadata)