Skip to content

bug: a failed send locks out a pre-restore invoice #1896

Closed

Description

@ovitrif

Description

After a restore, a failed Spark send of a pre-restore invoice locks that invoice out on both rails until it expires.

  1. Restore, then pay a still-valid invoice created before the restore. The operators show no send, so Spark sends it.
  2. The send fails, for example with no route. The operators now report FAILED.
  3. A retry over Spark or over the node reaches refuseUnverifiedRestoredInvoice, which reads FAILED as a send and throws RestoredInvoiceUnverified.

The user sees "Bitkit can't confirm this invoice wasn't paid before you restored your wallet" right after the app's own attempt failed.

The SDK returns FAILED only when every preimage request for the hash was returned. A live or completed request takes priority (send_status in breez/spark-sdk lightning_send_status.rs). So FAILED shows nothing is in flight or paid, which is already how earlierNodeSend reads a failed row.

To do

  • In SparkRepo.isUnsentPerOperators, count FAILED as unsent, and add a test for the retry after a failed send.
  • Start the new log line with a verb, for example "Found a '$status' Spark operator send of the pre-restore invoice".

Twin: synonymdev/bitkit-ios (same rule in refuseUnverifiedRestoredInvoice). Raised by @coreyphillips in #1893 (comment) and #1893 (comment).

Activity

  1. ovitrif commented on Nov 12, 2026

    @ovitrif
    CollaboratorAuthor

    Also in scope: the seedRestoredSendHashes KDoc in SparkRepo.kt still describes the removed wait for Spark's first listing. From #1893 (review).

  2. added this to the 3.2.0 milestone on Nov 12, 2026
  3. ovitrif commented on Nov 12, 2026

    @ovitrif
    CollaboratorAuthor

    Milestone 3.2.0: this issue is a bug in the Spark restore hold (#1858), which ships in 3.2.0.

  4. self-assigned this
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions