diff --git a/doc/PLUGINS.md b/doc/PLUGINS.md index 4ce23655f..6d3517eb9 100644 --- a/doc/PLUGINS.md +++ b/doc/PLUGINS.md @@ -1046,10 +1046,10 @@ before disconnection. For a 'continue'd result, you can also include a `close_to` address, which will be used as the output address for a mutual close transaction; you -can include a `psbt` and an `accepter_funding_msat` to contribute funds, +can include a `psbt` and an `our_funding_msat` to contribute funds, inputs and outputs to this channel open. -Note that, like `openchannel_init`, the `accepter_funding_msat` amount +Note that, like `openchannel_init` RPC call, the `our_funding_msat` amount must NOT be accounted for in any supplied output. Change, however, should be included and should use the `funding_feerate_per_kw` to calculate. @@ -1063,11 +1063,10 @@ e.g. "result": "continue", "close_to": "bc1qlq8srqnz64wgklmqvurv7qnr4rvtq2u96hhfg2" "psbt": "cHNidP8BADMCAAAAAQ+yBipSVZrrw28Oed52hTw3N7t0HbIyZhFdcZRH3+61AQAAAAD9////AGYAAAAAAQDfAgAAAAABARtaSZufCbC+P+/G23XVaQ8mDwZQFW1vlCsCYhLbmVrpAAAAAAD+////AvJs5ykBAAAAFgAUT6ORgb3CgFsbwSOzNLzF7jQS5s+AhB4AAAAAABepFNi369DMyAJmqX2agouvGHcDKsZkhwJHMEQCIHELIyqrqlwRjyzquEPvqiorzL2hrvdu9EBxsqppeIKiAiBykC6De/PDElnqWw49y2vTqauSJIVBgGtSc+vq5BQd+gEhAg0f8WITWvA8o4grxNKfgdrNDncqreMLeRFiteUlne+GZQAAAAEBIICEHgAAAAAAF6kU2Lfr0MzIAmapfZqCi68YdwMqxmSHAQQWABQB+tkKvNZml+JZIWRyLeSpXr7hZQz8CWxpZ2h0bmluZwEIexhVcpJl8ugM/AlsaWdodG5pbmcCAgABAA==", - "accepter_funding_msat": "39999000msat" + "our_funding_msat": "39999000msat" } ``` - Note that `close_to` must be a valid address for the current chain, an invalid address will cause the node to exit with an error. diff --git a/lightningd/dual_open_control.c b/lightningd/dual_open_control.c index c8dc6e712..9a924e0a5 100644 --- a/lightningd/dual_open_control.c +++ b/lightningd/dual_open_control.c @@ -723,9 +723,9 @@ openchannel2_hook_deserialize(struct openchannel2_payload *payload, if (json_get_member(buffer, toks, "psbt")) fatal("Plugin rejected openchannel2 but" " also set `psbt`"); - if (json_get_member(buffer, toks, "accepter_funding_msat")) + if (json_get_member(buffer, toks, "our_funding_msat")) fatal("Plugin rejected openchannel2 but" - " also set `accepter_funding_psbt`"); + " also set `our_funding_psbt`"); const jsmntok_t *t_errmsg = json_get_member(buffer, toks, "error_message"); @@ -773,9 +773,9 @@ openchannel2_hook_deserialize(struct openchannel2_payload *payload, type_to_string(tmpctx, struct wally_psbt, payload->psbt)); if (!hook_extract_amount(dualopend, buffer, toks, - "accepter_funding_msat", + "our_funding_msat", &payload->accepter_funding)) - fatal("Plugin failed to supply accepter_funding_msat field"); + fatal("Plugin failed to supply our_funding_msat field"); if (!payload->psbt && !amount_sat_eq(payload->accepter_funding, AMOUNT_SAT(0))) { diff --git a/tests/plugins/df_accepter.py b/tests/plugins/df_accepter.py index 31b0ede6c..77844da21 100755 --- a/tests/plugins/df_accepter.py +++ b/tests/plugins/df_accepter.py @@ -115,7 +115,7 @@ def on_openchannel(openchannel2, plugin, **kwargs): plugin.log("contributing {} at feerate {}".format(amount, proposed_feerate)) return {'result': 'continue', 'psbt': funding['psbt'], - 'accepter_funding_msat': amount} + 'our_funding_msat': amount} @plugin.hook('openchannel2_changed')