mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
wallet: make wallet_can_spend non-static because needed
This commit is contained in:
parent
d088288daa
commit
e8f43ef6ca
2 changed files with 15 additions and 2 deletions
|
@ -615,8 +615,8 @@ bool wallet_add_onchaind_utxo(struct wallet *w,
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool wallet_can_spend(struct wallet *w, const u8 *script,
|
||||
u32 *index, bool *output_is_p2sh)
|
||||
bool wallet_can_spend(struct wallet *w, const u8 *script,
|
||||
u32 *index, bool *output_is_p2sh)
|
||||
{
|
||||
struct ext_key ext;
|
||||
u64 bip32_max_index = db_get_intvar(w->db, "bip32_max_index", 0);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue