mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
psbt-open: method to quickly check if has our input
For dual-funding's accepter plugin, we only want to send psbts that need to be signed to `signpsbt`; this lets us quickly check if they're "signable"
This commit is contained in:
parent
7c76363e20
commit
9ba2f614bb
@ -481,3 +481,13 @@ bool psbt_input_is_ours(const struct wally_psbt_input *input)
|
||||
PSBT_TYPE_INPUT_MARKER, &unused);
|
||||
return !(!result);
|
||||
}
|
||||
|
||||
bool psbt_has_our_input(const struct wally_psbt *psbt)
|
||||
{
|
||||
for (size_t i = 0; i < psbt->num_inputs; i++) {
|
||||
if (psbt_input_is_ours(&psbt->inputs[i]))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -174,4 +174,8 @@ void psbt_input_mark_ours(const tal_t *ctx,
|
||||
*/
|
||||
bool psbt_input_is_ours(const struct wally_psbt_input *input);
|
||||
|
||||
/* psbt_has_our_input - Returns true if this psbt contains
|
||||
* any input that is ours
|
||||
*/
|
||||
bool psbt_has_our_input(const struct wally_psbt *psbt);
|
||||
#endif /* LIGHTNING_COMMON_PSBT_OPEN_H */
|
||||
|
Loading…
Reference in New Issue
Block a user