From 76b01695a026ecaa4076007b259a6064b0828bf5 Mon Sep 17 00:00:00 2001 From: jackstar12 <62219658+jackstar12@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:52:20 +0200 Subject: [PATCH] fix(boltz): check for direct onchain payments (#2732) --- lnbits/wallets/boltz.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lnbits/wallets/boltz.py b/lnbits/wallets/boltz.py index 0b3b063fa..ab90a6612 100644 --- a/lnbits/wallets/boltz.py +++ b/lnbits/wallets/boltz.py @@ -133,6 +133,17 @@ class BoltzWallet(Wallet): ) response: boltzrpc_pb2.CreateSwapResponse response = await self.rpc.CreateSwap(request, metadata=self.metadata) + + # empty swap id means that the invoice included a magic routing hint and was + # paid on the liquid network directly + # docs: https://docs.boltz.exchange/api/magic-routing-hints + if response.id == "": + # note that there is no way to provide a checking id here, + # but there is no need since it immediately is considered as successfull + return PaymentResponse( + ok=True, + checking_id=response.id, + ) except AioRpcError as exc: return PaymentResponse(ok=False, error_message=exc.details())