Skip to content

QuickPay waits ~10 s for the LDK node when opened from the background, even when Spark covers the amount #2028

Todo

Description

@jvsena42

When Bitkit is opened from the background by a payment request (an NFC tap or a lightning: tag), QuickPay waits for the LDK node to start before paying, even when Spark covers the amount. QuickPay starts about 10 s after Bitkit gets the request.

Found while running device cases on #1883 (bca0fa0ba), Xiaomi 22031116BG (Android 13) paying, regtest devDebug, Spark spending balance ~₿ 41,000, QuickPay on with the $5 threshold.

Steps

  1. Turn QuickPay on, with a Spark spending balance above the amount.
  2. Send Bitkit to the background long enough for the LDK node to stop.
  3. Tap a Bitkit Receive (Spending, ₿ 1,000) or a lightning: tag, and pick Bitkit in the chooser.

Observed

Run Request received Using QuickPay Spark COMPLETED
Tap on a phone's Receive 10:11:54.5 10:12:04.0 (+9.5 s) 10:12:10.9
Tap on a lightning: tag 10:15:39.2 10:15:49.1 (+9.9 s) 10:15:56.9

Between those lines the log shows Building node…, Waiting for node to load channels before sending payment and Node started. With the app in the foreground (node running), QuickPay starts 0.9 s after the read.

The #1883 description earlier recorded QuickPay starting 1.9 s after Bitkit opened the request on 2336ef1ca.

Videos are under Evidence in #1883 ("Bitkit in the background").

Cause

AppViewModel.kt:6776 on bca0fa0ba:

if (!open && isQuickPayOn && channelsAreSettling()) waitForUsableChannels(walletGeneration)

channelsAreSettling() returns true while the node is not running, and waitForUsableChannels is called without an amount, so the Spark-covers skip in it (sparkCovers = amountSats != null && ...) never applies. The comment says the wait is there to decide whether the payment needs the Spark update (moveToSparkRepo.needsUpdateToSend), because the balance is unknown while the node starts.

Expected

When Spark alone covers the amount, QuickPay should not wait for the LDK node, or it should only wait when the update check depends on node state.

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Nov 25, 2026
  2. added this to the 3.2.0 milestone on Nov 25, 2026
  3. ovitrif commented on Nov 25, 2026

    @ovitrif
    Collaborator

    Triage: 3.2.0, under the Spark epic. It slows nearby payments (NFC and lightning: taps) paid from Spark, both in the release's scope.

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