mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
psbt: Use wallys function to check PST finalization status
Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
This commit is contained in:
committed by
Rusty Russell
parent
1fe53880a7
commit
fef155a9e2
@@ -60,15 +60,12 @@ struct wally_psbt *new_psbt(const tal_t *ctx, const struct wally_tx *wtx)
|
||||
return tal_steal(ctx, psbt);
|
||||
}
|
||||
|
||||
bool psbt_is_finalized(struct wally_psbt *psbt)
|
||||
bool psbt_is_finalized(const struct wally_psbt *psbt)
|
||||
{
|
||||
for (size_t i = 0; i < psbt->num_inputs; i++) {
|
||||
if (!psbt->inputs[i].final_scriptsig &&
|
||||
!psbt->inputs[i].final_witness)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
size_t is_finalized;
|
||||
int wally_err = wally_psbt_is_finalized(psbt, &is_finalized);
|
||||
assert(wally_err == WALLY_OK);
|
||||
return is_finalized ? true : false;
|
||||
}
|
||||
|
||||
struct wally_psbt_input *psbt_add_input(struct wally_psbt *psbt,
|
||||
|
||||
@@ -29,7 +29,7 @@ struct wally_psbt *new_psbt(const tal_t *ctx,
|
||||
* a psbt has the finalized script sig and/or witness data populated
|
||||
* for such a call
|
||||
*/
|
||||
bool psbt_is_finalized(struct wally_psbt *psbt);
|
||||
bool psbt_is_finalized(const struct wally_psbt *psbt);
|
||||
|
||||
struct wally_tx *psbt_finalize(struct wally_psbt *psbt, bool finalize_in_place);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user