Skip to content
This repository was archived by the owner on Apr 17, 2020. It is now read-only.

Commit b1f0579

Browse files
niftyneirustyrussell
authored andcommitted
rpc: have fundchannel_start also return scriptpubkey
Easier to pass it back than dig it out of the address, since we have it. Needed for extracting fundchannel
1 parent 19e6506 commit b1f0579

4 files changed

+6
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010
- JSON API: `listfunds` now lists a blockheight for confirmed transactions
11+
- JSON API: `fundchannel_start` result now includes field `scriptpubkey`
1112

1213
- bolt11: support for parsing feature bits (field `9`).
1314

doc/lightning-fundchannel_start.7

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ transaction before that can lead to unrecoverable loss of funds\.
3434

3535
.SH RETURN VALUE
3636

37-
On success, returns the \fIfunding_address\fR for the channel\.
37+
On success, returns the \fIfunding_address\fR and the \fIscriptpubkey\fR for the channel funding output\.
3838

3939

4040
On failure, returns an error\.

doc/lightning-fundchannel_start.7.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ transaction before that can lead to unrecoverable loss of funds.
3232
RETURN VALUE
3333
------------
3434

35-
On success, returns the *funding\_address* for the channel.
35+
On success, returns the *funding\_address* and the *scriptpubkey* for the channel funding output.
3636

3737
On failure, returns an error.
3838

lightningd/opening_control.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,10 @@ static void funding_started_success(struct funding_channel *fc,
343343
out = encode_scriptpubkey_to_addr(cmd,
344344
get_chainparams(cmd->ld)->bip173_name,
345345
scriptPubkey);
346-
if (out)
346+
if (out) {
347347
json_add_string(response, "funding_address", out);
348+
json_add_hex_talarr(response, "scriptpubkey", scriptPubkey);
349+
}
348350

349351
/* Clear this so cancel doesn't think it's still in progress */
350352
fc->cmd = NULL;

0 commit comments

Comments
 (0)