Skip to content

lightningd: convert the PSBTs dual-open commands and hooks take to version 2 - #53

Merged
kwsantiago merged 1 commit into
blake2b-unifiedfrom
dualopen-psbt-v2
Oct 19, 2026
Merged

kwsantiago merged 1 commit into
blake2b-unifiedfrom
dualopen-psbt-v2

Conversation

@kwsantiago

Copy link
Copy Markdown

openchannel_update, openchannel_signed and openchannel_bump took their PSBT as given, and so did the results of the dual-funding hooks (openchannel2, openchannel2_changed, openchannel2_sign, rbf_channel). Code after that assumes version 2: a version 0 PSBT, which bitcoind and many wallets produce, aborted lightningd on an assertion in psbt_txid or psbt_contribs_changed.

They now convert it to version 2, as openchannel_init and the splice commands already do. A command fails if the PSBT can't be converted; a hook result that can't be is fatal, as an unparseable one already is.

Tests:

  • test_v2_open_psbt_version_0: the opener passes version 0 PSBTs to openchannel_init, openchannel_update and openchannel_signed, and the accepter (a test plugin, df_accept_psbt_v0.py) returns version 0 PSBTs from openchannel2 and openchannel2_sign.
  • test_v2_rbf_psbt_version_0: openchannel_bump, openchannel_update and openchannel_signed with version 0 PSBTs.

Without the change both abort lightningd (FATAL SIGNAL 6, in psbt_txid).

Changelog-None

@kwsantiago
kwsantiago merged commit 2cbd583 into blake2b-unified Oct 19, 2026
89 of 91 checks passed
@kwsantiago
kwsantiago deleted the dualopen-psbt-v2 branch October 19, 2026 23:06
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