openchannel2_changed -- Hook for handling updates to the dual-funding PSBT
DESCRIPTION
The openchannel2_changed hook is called when the peer sends an updated PSBT during dual-funding channel negotiation.
This allows plugins to inspect and modify the PSBT before it is sent back to the peer.
The negotiation continues until neither side makes further changes to the PSBT, at which point commitment transactions are exchanged.
See plugins/funder.c for an example of how to use this hook to continue a v2 channel open.
HOOK PAYLOAD
- openchannel2_changed (object):
- channel_id (hash): The temporary channel_id identifying the channel being negotiated.
- psbt (string): The current Partially Signed Bitcoin Transaction (PSBT) representing the funding transaction.
This PSBT includes contributions from both peers and may be modified. - require_confirmed_inputs (boolean): Indicates whether the remote peer requires all inputs in the PSBT to be confirmed.
If true, the plugin must avoid adding unconfirmed inputs. (added v23.02)
HOOK RETURN
- result (string) (always "continue"): Must be set to
continueto proceed with the channel opening negotiation. - psbt (string): The updated PSBT to send back to the peer.
If no modifications are made, this should be identical to the input PSBT.
EXAMPLES
Example 1:
Request:
lightning-cli openchannel2_changed -k "openchannel2_changed"='{"channel_id": "252d1b0a1e57895e841...", "psbt": "cHNidP8BADMCAAAAAQ+yBipSVZr...", "require_confirmed_inputs": true}'{
"id": "example:openchannel2_changed#1",
"method": "openchannel2_changed",
"params": {
"openchannel2_changed": {
"channel_id": "252d1b0a1e57895e841...",
"psbt": "cHNidP8BADMCAAAAAQ+yBipSVZr...",
"require_confirmed_inputs": true
}
}
}Response:
{
"result": "continue",
"psbt": "cHNidP8BADMCAAAAAQ+yBipSVZr..."
}