wallet: make wallet_can_spend non-static because needed

This commit is contained in:
Ken Sedgwick 2021-12-09 10:05:58 -08:00 committed by Rusty Russell
parent d088288daa
commit e8f43ef6ca
2 changed files with 15 additions and 2 deletions

View file

@ -615,7 +615,7 @@ bool wallet_add_onchaind_utxo(struct wallet *w,
return true;
}
static bool wallet_can_spend(struct wallet *w, const u8 *script,
bool wallet_can_spend(struct wallet *w, const u8 *script,
u32 *index, bool *output_is_p2sh)
{
struct ext_key ext;

View file

@ -490,6 +490,19 @@ void wallet_unreserve_utxo(struct wallet *w, struct utxo *utxo,
struct utxo *wallet_utxo_get(const tal_t *ctx, struct wallet *w,
const struct bitcoin_outpoint *outpoint);
/**
* wallet_can_spend - Do we have the private key matching this scriptpubkey?
*
* FIXME: This is very slow with lots of inputs!
*
* @w: (in) wallet holding the pubkeys to check against (privkeys are on HSM)
* @script: (in) the script to check
* @index: (out) the bip32 derivation index that matched the script
* @output_is_p2sh: (out) whether the script is a p2sh, or p2wpkh
*/
bool wallet_can_spend(struct wallet *w, const u8 *script,
u32 *index, bool *output_is_p2sh);
/**
* wallet_get_newindex - get a new index from the wallet.
* @ld: (in) lightning daemon