Skip to content

Commit

Permalink
fix splits
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Nov 28, 2024
1 parent 1a41cd2 commit 6ac1177
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,22 @@ async def on_invoice_paid(payment: Payment) -> None:
target.wallet, payment.wallet_id, safe_amount_msat, memo
)
else:
payment = await create_invoice(
new_payment = await create_invoice(
wallet_id=target.wallet,
amount=int(amount_msat / 1000),
internal=True,
memo=memo,
)
payment_request = payment.bolt11
payment_request = new_payment.bolt11

extra = {**payment.extra, "tag": "splitpayments", "splitted": True}
extra = {**payment.extra, "splitted": True}

if payment_request:
await pay_invoice(
payment_request=payment_request,
wallet_id=payment.wallet_id,
description=memo,
extra=extra,
tag="splitpayments",
)


Expand All @@ -90,7 +89,7 @@ async def get_lnurl_invoice(
r = await client.get(
data["callback"],
params={"amount": rounded_amount, "comment": memo},
timeout=40,
timeout=5,
)
if r.is_error:
raise httpx.ConnectError("issue with scrub callback")
Expand Down

0 comments on commit 6ac1177

Please sign in to comment.