addr: handle P2SH/P2PKH in scriptpubkey encoding

Previously, returned null if a scriptpubkey was not Segwit; now
handles encoding to Base58 for other types.
This commit is contained in:
lisa neigut
2019-10-29 12:00:18 -05:00
committed by Rusty Russell
parent 6f215a70e5
commit 963a1da958
8 changed files with 31 additions and 14 deletions

View File

@@ -301,7 +301,7 @@ static void funding_started_success(struct funding_channel *fc,
response = json_stream_success(cmd);
out = encode_scriptpubkey_to_addr(cmd,
get_chainparams(cmd->ld)->bip173_name,
get_chainparams(cmd->ld),
scriptPubkey);
if (out) {
json_add_string(response, "funding_address", out);