Skip to content

fix: release txprepare reservations on send failure#8989

Open
vincenzopalazzo wants to merge 2 commits intoElementsProject:masterfrom
vincenzopalazzo:codex/fix-withdraw-unreserve-8925
Open

fix: release txprepare reservations on send failure#8989
vincenzopalazzo wants to merge 2 commits intoElementsProject:masterfrom
vincenzopalazzo:codex/fix-withdraw-unreserve-8925

Conversation

@vincenzopalazzo
Copy link
Copy Markdown
Collaborator

@vincenzopalazzo vincenzopalazzo commented Mar 25, 2026

Summary

  • unreserve the original txprepare/withdraw PSBT inputs when signpsbt or sendpsbt fails
  • keep the immediate-send success path unchanged
  • add a regression test for a withdraw-all broadcast failure that used to leave funds reserved

Root cause

withdraw and txsend reserve inputs through the initial fundpsbt/utxopsbt call, then hand the PSBT to signpsbt and sendpsbt. If signing or broadcasting fails, the plugin forwarded the error without calling unreserveinputs, so the original reservation remained stuck even though the immediate-send flow had aborted.

Verification

  • uv run --group dev pytest tests/test_wallet.py -k withdraw_unreserves_inputs_on_send_failure -q
  • uv run --group dev pytest tests/test_wallet.py -k 'test_txsend or test_withdraw' -q\n\nChangelog-None\n\nFixes Double-reservation in the withdraw flow #8925

Clean up the original PSBT reservation when withdraw/txsend fail after signing or broadcast.

Include the final withdraw regression coverage, including the liquid-safe address handling needed for CI.

Fixes ElementsProject#8925
Stabilize unrelated valgrind flakes encountered while validating the withdraw reservation fix.

Disable cln-grpc in gossip tests that do not exercise grpc startup, relax the duplicate channel_announcement expectation under valgrind, and fix the expected broken-log pattern in test_important_plugin.
@vincenzopalazzo vincenzopalazzo force-pushed the codex/fix-withdraw-unreserve-8925 branch from 2b4ff9f to a8c5646 Compare March 26, 2026 18:22
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.

1 participant