mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 18:57:06 +01:00
Add support for withdrawing to P2SH addresses.
This commit is contained in:
parent
d43fb87871
commit
9842898ca4
1 changed files with 4 additions and 0 deletions
|
@ -81,11 +81,15 @@ static u8 *scriptpubkey_from_address(const tal_t *cxt, bool *testnet,
|
||||||
const char *addr, size_t addrlen)
|
const char *addr, size_t addrlen)
|
||||||
{
|
{
|
||||||
struct bitcoin_address p2pkh_destination;
|
struct bitcoin_address p2pkh_destination;
|
||||||
|
struct ripemd160 p2sh_destination;
|
||||||
u8 *script = NULL;
|
u8 *script = NULL;
|
||||||
|
|
||||||
if (bitcoin_from_base58(testnet, &p2pkh_destination,
|
if (bitcoin_from_base58(testnet, &p2pkh_destination,
|
||||||
addr, addrlen)) {
|
addr, addrlen)) {
|
||||||
script = scriptpubkey_p2pkh(cxt, &p2pkh_destination);
|
script = scriptpubkey_p2pkh(cxt, &p2pkh_destination);
|
||||||
|
} else if (p2sh_from_base58(testnet, &p2sh_destination,
|
||||||
|
addr, addrlen)) {
|
||||||
|
script = scriptpubkey_p2sh_hash(cxt, &p2sh_destination);
|
||||||
}
|
}
|
||||||
/* TODO Insert other supported addresses here. */
|
/* TODO Insert other supported addresses here. */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue