Skip to content

Commit 463fd96

Browse files
committed
fixup! Splice: Clone psbts instead of steal
1 parent f5ce59c commit 463fd96

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

channeld/channeld.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -4163,7 +4163,7 @@ static void splice_initiator_user_update(struct peer *peer, const u8 *inmsg)
41634163
assert(peer->splicing->current_psbt);
41644164
/* peer->splicing->current_psbt represents what PSBT we have sent to
41654165
* our peer so far. */
4166-
ictx->current_psbt = peer->splicing->current_psbt;
4166+
ictx->current_psbt = clone_psbt(ictx, peer->splicing->current_psbt);
41674167
ictx->tx_add_input_count = peer->splicing->tx_add_input_count;
41684168
ictx->tx_add_output_count = peer->splicing->tx_add_output_count;
41694169

@@ -4190,8 +4190,7 @@ static void splice_initiator_user_update(struct peer *peer, const u8 *inmsg)
41904190
peer->splicing->tx_add_input_count = ictx->tx_add_input_count;
41914191
peer->splicing->tx_add_output_count = ictx->tx_add_output_count;
41924192

4193-
if (peer->splicing->current_psbt != ictx->current_psbt)
4194-
tal_free(peer->splicing->current_psbt);
4193+
tal_free(peer->splicing->current_psbt);
41954194
peer->splicing->current_psbt = clone_psbt(peer->splicing,
41964195
ictx->current_psbt);
41974196

common/interactivetx.c

-5
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,6 @@ char *process_interactivetx_updates(const tal_t *ctx,
408408
* Otherwise we advance `current_psbt` to `next_psbt` and begin
409409
* processing the change set in `ictx->change_set` */
410410
if (ictx->current_psbt != next_psbt) {
411-
/* psbt_get_changeset requires we keep the current_psbt until
412-
* we're done withh change_set */
413-
tal_steal(ictx->change_set, ictx->current_psbt);
414411
ictx->current_psbt = next_psbt;
415412
}
416413

@@ -800,7 +797,5 @@ char *process_interactivetx_updates(const tal_t *ctx,
800797
/* Sort psbt! */
801798
psbt_sort_by_serial_id(ictx->current_psbt);
802799

803-
tal_steal(ictx, ictx->current_psbt);
804-
805800
return NULL;
806801
}

0 commit comments

Comments
 (0)