df: pass back 'close_to' for completed/commitment secured channels

When commitments are secured, also return the 'close_to' script if we've
got a local_upfront_shutdown_script set.
This commit is contained in:
niftynei
2020-10-26 14:40:00 -05:00
committed by neil saitug
parent 405453859c
commit 6077eca660
4 changed files with 35 additions and 2 deletions

View File

@@ -715,7 +715,7 @@ openchannel_update_ok(struct command *cmd,
json_tok_full(buf, result));
if (done) {
const jsmntok_t *outnum_tok;
const jsmntok_t *outnum_tok, *close_to_tok;
outnum_tok = json_get_member(buf, result, "funding_outnum");
if (!outnum_tok)
@@ -732,6 +732,14 @@ openchannel_update_ok(struct command *cmd,
json_tok_full_len(result),
json_tok_full(buf, result));
close_to_tok = json_get_member(buf, result, "close_to");
if (close_to_tok)
dest->close_to_script =
json_tok_bin_from_hex(dest->mfc, buf,
close_to_tok);
else
dest->close_to_script = NULL;
/* It's possible they beat us to the SIGNED flag,
* in which case we just let that be the more senior
* state position */