Skip to content

Commit 4fca656

Browse files
committed
fixup! Splice: Clone psbts instead of steal
1 parent b2fefae commit 4fca656

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

channeld/channeld.c

Lines changed: 2 additions & 3 deletions
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

Lines changed: 0 additions & 5 deletions
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

@@ -806,7 +803,5 @@ char *process_interactivetx_updates(const tal_t *ctx,
806803
/* Sort psbt! */
807804
psbt_sort_by_serial_id(ictx->current_psbt);
808805

809-
tal_steal(ictx, ictx->current_psbt);
810-
811806
return NULL;
812807
}

0 commit comments

Comments
 (0)