Skip to content

[codex] Use local regtest tx status for channel confirmations - #716

Open
caydyan wants to merge 2 commits into
stakwork:masterfrom
caydyan:codex/regtest-channel-confirmations-182
Open

[codex] Use local regtest tx status for channel confirmations#716
caydyan wants to merge 2 commits into
stakwork:masterfrom
caydyan:codex/regtest-channel-confirmations-182

Conversation

@caydyan

@caydyan caydyan commented Jun 14, 2026

Copy link
Copy Markdown

Fixes #182.

This fixes the CLN channel confirmation display when the stack runs on regtest. The channel UI was asking mempool.space for the funding transaction, which does not work for local regtest channel funding transactions.

Changes:

  • add a Bitcoind GetTransactionStatus command backed by local bitcoind RPC
  • return confirmed state, block height, and confirmation count from getrawtransaction plus block header lookup
  • have the frontend use local bitcoind for regtest channel confirmation checks
  • keep mempool.space lookup for non-regtest stacks

Validation:

  • cargo check
  • cargo test --lib (21 passed)
  • npm run build
  • git diff --check
  • rustfmt --edition 2021 --check src/conn/bitcoin/bitcoinrpc.rs src/cmd.rs

Note: npm run check still fails on existing unrelated repo-wide Svelte/TypeScript diagnostics in files such as api/swarm.ts, Flow.svelte, Boltwall.svelte, Jarvis.svelte, NodeVersionupdater.svelte, and NodeStats.svelte; I did not touch those paths. Repo-wide cargo fmt --check also reports pre-existing formatting drift outside the touched Rust files, so I validated the touched Rust files directly.

Bounty note: this PR is intended for the Sphinx 350,000 sat bounty attached to issue #182. BTC payout address: bc1qev5ant33v5y89qqjvcf4mh9hlax5svqf5xd7gc.

@caydyan
caydyan marked this pull request as ready for review June 14, 2026 17:37
@caydyan

caydyan commented Jun 14, 2026

Copy link
Copy Markdown
Author

Updated this PR to make the regtest confirmation lookup visible and stable in the UI: computed inactive-channel confirmation counts are now written back to the channel store, and the parent channel poll preserves those counts instead of resetting them on the next refresh. The Bitcoind tag selection now also follows the lightning node's linked Btc node when available.

Validation run locally:

  • cargo check
  • cargo test --lib (21 passed)
  • npm run build
  • git diff --check origin/master...HEAD
  • rustfmt --edition 2021 --check src/conn/bitcoin/bitcoinrpc.rs src/cmd.rs

I also ran npm run check. It still fails on existing repo-wide Svelte/TypeScript diagnostics outside this PR's touched files, including app/src/api/swarm.ts, app/src/Flow.svelte, app/src/Boltwall.svelte, app/src/Jarvis.svelte, app/src/components/NodeVersionupdater.svelte, app/src/controls/Controller.svelte, and app/src/nodes/NodeStats.svelte.

@caydyan

caydyan commented Jun 14, 2026

Copy link
Copy Markdown
Author

Follow-up pushed in 347bbc9 after the initial implementation.

Additional scope:

  • persist computed pending-channel confirmation counts back into the channel store so the regular channel refresh does not immediately erase the UI value
  • preserve existing confirmation counts across channel-list refreshes until the channel becomes active
  • resolve the linked bitcoind node from the lightning node links before falling back to the first internal bitcoind

Validation on the current head:

  • cargo check
  • npm run build
  • git diff --check origin/master...HEAD
  • npm run check still fails on existing unrelated repo-wide Svelte/TypeScript diagnostics (api/swarm.ts, Flow.svelte, Boltwall.svelte, Jarvis.svelte, NodeVersionupdater.svelte, NodeStats.svelte, etc.); no new touched-file error was reported in the visible output
  • cargo test --lib now reaches 20 passed / 1 failed, with the failure in dock::tests::test_ghcr_version_check because the GHCR version lookup returned empty current/latest version fields; this test is external registry-dependent and unrelated to the touched bitcoind/channel-confirmation paths

@caydyan

caydyan commented Jun 14, 2026

Copy link
Copy Markdown
Author

Reran validation on the same head 347bbc9 after the transient GHCR-dependent test result noted above.

Current local result:

  • cargo test --lib now passes: 21 passed, 0 failed
  • cargo check passes
  • npm run build passes
  • git diff --check origin/master...HEAD passes
  • rustfmt --edition 2021 --check src/conn/bitcoin/bitcoinrpc.rs src/cmd.rs passes

The earlier dock::tests::test_ghcr_version_check failure was from an external GHCR version lookup returning empty version fields during that run; it did not reproduce on rerun. Working tree is clean after removing build output noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Channel shows 0 confirmations in the UI until it hits 3

1 participant