You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Multiple InvoiceReceived events for single pay_for_offer call #3653
I had a simple unit test that would spin up 2 nodes and pay a bolt12 offer between them. My InvoiceReceived event handler was not idempotent and would throw if duplicates came in, this caused me to notice that I was receiving multiples of the same event. Found this when upgrading from 0.0.125 to 0.1.1. Can provide logs and code if more info is needed.
Edit: it seems send_payment_for_bolt12_invoice is not idempotent either so this would effect everyone using manually_handle_bolt12_invoices
Yeah, we need to check PendingOutboundPayment before generating that event.
We're currently looking into dropping manually_handle_bolt12_invoices and the InvoiceReceived event in favor of a different way of examining BOLT12 messages. Could you describe your use case for needing manually_handle_bolt12_invoices?
Thinking about this more, we'll probably want to transition to PendingOutboundPayment::InvoiceReceived in this case, which is currently only used as an ephemeral state. And then allow paying an invoice in this state.
Interested in this because I was planning to open an RFC PR to propose removing the ``
Due with #3593 we receive the invoice anyway through the PaymentSend event
We are iterating on a couple ideas, namely #3412 and #3639.
Activity
jkczyz commentedon Mar 7, 2025
Yeah, we need to check
PendingOutboundPaymentbefore generating that event.We're currently looking into dropping
manually_handle_bolt12_invoicesand theInvoiceReceivedevent in favor of a different way of examining BOLT12 messages. Could you describe your use case for needingmanually_handle_bolt12_invoices?vincenzopalazzo commentedon Mar 7, 2025
Interested in this because I was planning to open an RFC PR to propose removing the ``
Due with #3593 we receive the invoice anyway through the
PaymentSendeventjkczyz commentedon Mar 7, 2025
Thinking about this more, we'll probably want to transition to
PendingOutboundPayment::InvoiceReceivedin this case, which is currently only used as an ephemeral state. And then allow paying an invoice in this state.We are iterating on a couple ideas, namely #3412 and #3639.
benthecarman commentedon Mar 7, 2025
It's so I can save the bolt12 invoice and track the payment
https://github.com/benthecarman/rld/blob/master/src/events.rs#L764