mirror of
https://github.com/daywalker90/cln-nip47.git
synced 2026-08-13 12:33:43 +02:00
holdinvoice_accepted_handler waited on the hold plugin track stream and sent a HoldInvoiceAccepted notification afterwards, without checking the reason the stream ended. When an invoice was cancelled, the stream just closes and the handler still sent a spurious accepted notification. Only send the notification if the stream actually reported the invoice as accepted. The hold plugin has no expired state: an invoice that expires without ever being accepted stays Unpaid and the track stream never ends, so the handler previously hung forever, holding a task and a gRPC stream open. Pass the invoice's expiry into the handler and time out the track stream at that point (capped), so it gives up on expired invoices and never sends a spurious accepted notification. When re-spawning pending invoices at startup, derive the expiry from the decoded bolt11. Add test_hold_invoice_expiry which creates an invoice with a short expiry and asserts the handler gives up without sending the notification. |
||
|---|---|---|
| .. | ||
| config.toml | ||
| conftest.py | ||
| nostr-rs-relay.tar.gz | ||
| pyproject.toml | ||
| setup.sh | ||
| test_cln-nip47.py | ||
| util.py | ||
| uv.lock | ||