mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-07 08:04:23 +01:00
psbt: add 'wally_psbt_clone' function, to clone a psbt
We'll need this for settng the tx correctly, for reasons
This commit is contained in:
committed by
Christian Decker
parent
d737b54625
commit
3c6e3eecee
@@ -17,6 +17,18 @@
|
||||
memmove((arr) + (pos), (arr) + (pos) + 1, \
|
||||
sizeof(*(arr)) * ((num) - ((pos) + 1)))
|
||||
|
||||
/* FIXME: someday this will break, because it's been exposed in libwally */
|
||||
int wally_psbt_clone(const struct wally_psbt *psbt, struct wally_psbt **output)
|
||||
{
|
||||
int ret;
|
||||
size_t byte_len;
|
||||
const u8 *bytes = psbt_get_bytes(NULL, psbt, &byte_len);
|
||||
|
||||
ret = wally_psbt_from_bytes(bytes, byte_len, output);
|
||||
tal_free(bytes);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void psbt_destroy(struct wally_psbt *psbt)
|
||||
{
|
||||
wally_psbt_free(psbt);
|
||||
|
||||
@@ -12,6 +12,8 @@ struct wally_psbt_input;
|
||||
struct wally_tx;
|
||||
struct amount_sat;
|
||||
|
||||
int wally_psbt_clone(const struct wally_psbt *psbt, struct wally_psbt **output);
|
||||
|
||||
void psbt_destroy(struct wally_psbt *psbt);
|
||||
|
||||
struct wally_psbt *new_psbt(const tal_t *ctx,
|
||||
|
||||
Reference in New Issue
Block a user