mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +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)
|
||||
{
|
||||
struct bitcoin_address p2pkh_destination;
|
||||
struct ripemd160 p2sh_destination;
|
||||
u8 *script = NULL;
|
||||
|
||||
if (bitcoin_from_base58(testnet, &p2pkh_destination,
|
||||
addr, addrlen)) {
|
||||
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. */
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue