mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
psbt_open: method for adding a witness_stack to a psbt input
Set a stack of witnesses onto a PSBT input
This commit is contained in:
@@ -471,3 +471,15 @@ bool psbt_has_required_fields(struct wally_psbt *psbt)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void psbt_input_set_final_witness_stack(struct wally_psbt_input *in,
|
||||||
|
const struct witness_element **elements)
|
||||||
|
{
|
||||||
|
wally_tx_witness_stack_init_alloc(tal_count(elements),
|
||||||
|
&in->final_witness);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < tal_count(elements); i++)
|
||||||
|
wally_tx_witness_stack_add(in->final_witness,
|
||||||
|
elements[i]->witness,
|
||||||
|
tal_bytelen(elements[i]->witness));
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ struct wally_psbt;
|
|||||||
struct wally_psbt_input;
|
struct wally_psbt_input;
|
||||||
struct wally_psbt_output;
|
struct wally_psbt_output;
|
||||||
struct wally_map;
|
struct wally_map;
|
||||||
|
struct witness_element;
|
||||||
|
|
||||||
struct input_set {
|
struct input_set {
|
||||||
struct wally_tx_input tx_input;
|
struct wally_tx_input tx_input;
|
||||||
@@ -140,4 +141,11 @@ int psbt_find_serial_output(struct wally_psbt *psbt, u16 serial_id);
|
|||||||
*/
|
*/
|
||||||
bool psbt_has_required_fields(struct wally_psbt *psbt);
|
bool psbt_has_required_fields(struct wally_psbt *psbt);
|
||||||
|
|
||||||
|
/* psbt_input_set_final_witness_stack - Set the witness stack for PSBT input
|
||||||
|
*
|
||||||
|
* @in - input to set final_witness for
|
||||||
|
* @witness_element - elements to add to witness stack
|
||||||
|
*/
|
||||||
|
void psbt_input_set_final_witness_stack(struct wally_psbt_input *in,
|
||||||
|
const struct witness_element **elements);
|
||||||
#endif /* LIGHTNING_COMMON_PSBT_OPEN_H */
|
#endif /* LIGHTNING_COMMON_PSBT_OPEN_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user