fix(boltz): check for direct onchain payments (#2732)
This commit is contained in:
parent
d7065392d1
commit
76b01695a0
1 changed files with 11 additions and 0 deletions
|
|
@ -133,6 +133,17 @@ class BoltzWallet(Wallet):
|
||||||
)
|
)
|
||||||
response: boltzrpc_pb2.CreateSwapResponse
|
response: boltzrpc_pb2.CreateSwapResponse
|
||||||
response = await self.rpc.CreateSwap(request, metadata=self.metadata)
|
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:
|
except AioRpcError as exc:
|
||||||
return PaymentResponse(ok=False, error_message=exc.details())
|
return PaymentResponse(ok=False, error_message=exc.details())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue