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);
|
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++) {
|
size_t is_finalized;
|
||||||
if (!psbt->inputs[i].final_scriptsig &&
|
int wally_err = wally_psbt_is_finalized(psbt, &is_finalized);
|
||||||
!psbt->inputs[i].final_witness)
|
assert(wally_err == WALLY_OK);
|
||||||
return false;
|
return is_finalized ? true : false;
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wally_psbt_input *psbt_add_input(struct wally_psbt *psbt,
|
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
|
* a psbt has the finalized script sig and/or witness data populated
|
||||||
* for such a call
|
* 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);
|
struct wally_tx *psbt_finalize(struct wally_psbt *psbt, bool finalize_in_place);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user