From c36b5131c0db7e6675ee2b5f0020e809b14c0da7 Mon Sep 17 00:00:00 2001 From: arcbtc Date: Wed, 12 Feb 2025 13:48:34 +0000 Subject: [PATCH] Fix: Keys were not working for splits --- tasks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks.py b/tasks.py index c27ef08..8f04320 100644 --- a/tasks.py +++ b/tasks.py @@ -6,6 +6,7 @@ from typing import Optional import bolt11 import httpx from lnbits.core.crud import get_standalone_payment +from lnbits.core.crud.wallets import get_wallet_for_key from lnbits.core.models import Payment from lnbits.core.services import create_invoice, fee_reserve, pay_invoice from lnbits.tasks import register_invoice_listener @@ -56,6 +57,9 @@ async def on_invoice_paid(payment: Payment) -> None: target.wallet, payment.wallet_id, safe_amount_msat, memo ) else: + wallet = await get_wallet_for_key(target.wallet) + if wallet is not None: + target.wallet = wallet.id new_payment = await create_invoice( wallet_id=target.wallet, amount=int(amount_msat / 1000),