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
A Lightning invoice paid through Spark can be paid twice when the app sends it again after an attempt whose outcome it didn't learn: a crash or kill during the send, a timeout, a relaunch, or a restore before Spark's history synced.
Why
Breez spark-sdk 0.28.3 dedupes send_payment only on its idempotency_key. An invoice with a Spark route hint goes out as a plain Spark transfer with no payment hash, so neither the operators nor fetch_lightning_send_status can tell the invoice was already paid. Two attempts with different keys both pay.
Android passes a random key per attempt, and refuses a send while Spark's history can't be read, which also blocks payments that would be safe.
iOS passes no key on the BOLT11 send.
Fix
Derive the key from a seed secret, the payment hash and an attempt number, so a retry reuses its attempt's key: the operators return a transfer committed under it instead of sending again. The attempt number moves on only after Spark shows that attempt failed.
Activity
[-]bug: a retried spark invoice can be paid twice[/-][+]fix: use spark send key in retry[/+]