diff --git a/common/interactivetx.c b/common/interactivetx.c index cb25f9c84355..b0082d140b31 100644 --- a/common/interactivetx.c +++ b/common/interactivetx.c @@ -425,6 +425,9 @@ char *process_interactivetx_updates(const tal_t *ctx, * Otherwise we advance `current_psbt` to `next_psbt` and begin * processing the change set in `ictx->change_set` */ if (ictx->current_psbt != next_psbt) { + /* psbt_get_changeset requires we keep the current_psbt until + * we're done withh change_set */ + tal_steal(ictx->change_set, ictx->current_psbt); ictx->current_psbt = next_psbt; } @@ -845,6 +848,8 @@ char *process_interactivetx_updates(const tal_t *ctx, /* Sort psbt! */ psbt_sort_by_serial_id(ictx->current_psbt); + tal_steal(ictx, ictx->current_psbt); + if (ictx->current_psbt) clone_psbt(NULL, ictx->current_psbt); if (ictx->desired_psbt)