mirror of
https://github.com/ElementsProject/lightning.git
synced 2026-08-13 12:32:55 +02:00
Don't assume it's a tal array: this is useful for dealing with wally_tx internals. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
17 lines
551 B
C
17 lines
551 B
C
#ifndef LIGHTNING_COMMON_ADDR_H
|
|
#define LIGHTNING_COMMON_ADDR_H
|
|
#include "config.h"
|
|
#include <bitcoin/chainparams.h>
|
|
|
|
/* Given a scriptPubkey, return an encoded address for p2pkh/p2w{pkh,sh}/p2tr */
|
|
char *encode_scriptpubkey_to_addr(const tal_t *ctx,
|
|
const struct chainparams *chainparams,
|
|
const u8 *scriptpubkey,
|
|
size_t scriptpubkey_len);
|
|
|
|
bool decode_scriptpubkey_from_addr(const tal_t *ctx,
|
|
const struct chainparams *chainparams,
|
|
const char *address,
|
|
u8 **scriptpubkey);
|
|
|
|
#endif /* LIGHTNING_COMMON_ADDR_H */
|