mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-05 23:24:21 +01:00
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:
committed by
Rusty Russell
parent
6f215a70e5
commit
963a1da958
@@ -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);
|
||||
|
||||
@@ -82,6 +82,11 @@ void connect_succeeded(struct lightningd *ld UNNEEDED, const struct node_id *id
|
||||
void delay_then_reconnect(struct channel *channel UNNEEDED, u32 seconds_delay UNNEEDED,
|
||||
const struct wireaddr_internal *addrhint TAKES UNNEEDED)
|
||||
{ fprintf(stderr, "delay_then_reconnect called!\n"); abort(); }
|
||||
/* Generated stub for encode_scriptpubkey_to_addr */
|
||||
char *encode_scriptpubkey_to_addr(const tal_t *ctx UNNEEDED,
|
||||
const struct chainparams *chainparams UNNEEDED,
|
||||
const u8 *scriptPubkey UNNEEDED)
|
||||
{ fprintf(stderr, "encode_scriptpubkey_to_addr called!\n"); abort(); }
|
||||
/* Generated stub for fail_htlc */
|
||||
void fail_htlc(struct htlc_in *hin UNNEEDED, enum onion_type failcode UNNEEDED)
|
||||
{ fprintf(stderr, "fail_htlc called!\n"); abort(); }
|
||||
|
||||
Reference in New Issue
Block a user