Skip to content

bug: failed swap hold payment keeps the claim poll running #1920

Closed

Description

@ovitrif

When a swap-routed send's hold payment fails, the swap's claim poll keeps running for about 70 minutes.

Why

  • The poll runs in scope.async (PubkySwapsRouteRepo.kt:152, since 490bdb4), so claim.cancel() in awaitSwapClaim (AppViewModel.kt:7450) no longer stops it when the hold payment fails.
  • The provider never funds a swap whose hold invoice wasn't paid, and bitkit-core reports it as AwaitingLockup until the lockup timeout. So the poll calls pubkySwapsAdvance every 2 s for the 10-minute CLAIM_TIMEOUT. Each call loads the mnemonic and opens a new Electrum connection.
  • Then the timeout branch starts advanceInBackground, which polls every 30 s for another hour. Each retry of a failing hold payment adds another pair.

Fix

Stop the poll only on a known hold failure, so a cleared screen still leaves the claim running (what 490bdb4 fixed): pass the hold failure into the async, select on it there, and skip advanceInBackground when it wins.

iOS is not affected: its claim.cancel() stops the poll, and awaitClaim starts the background advance only after a claim or a timeout.

Found in review of #1732: #1732 (comment)

Activity

  1. added this to the 3.3.0 milestone on Nov 14, 2026
  2. self-assigned this
    on Nov 14, 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