Skip to content

Commit 7b18184

Browse files
remyersddustin
authored andcommitted
Add debug outputs and fix prevtx issue
1 parent 6564aae commit 7b18184

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

channeld/channeld.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4141,6 +4141,10 @@ static void splice_initiator_user_update(struct peer *peer, const u8 *inmsg)
41414141
ictx->tx_add_input_count = peer->splicing->tx_add_input_count;
41424142
ictx->tx_add_output_count = peer->splicing->tx_add_output_count;
41434143

4144+
ictx->shared_outpoint = tal(ictx, struct bitcoin_outpoint);
4145+
*ictx->shared_outpoint = peer->channel->funding;
4146+
ictx->funding_tx = bitcoin_tx_from_txid(peer, peer->channel->funding.txid);
4147+
41444148
/* If there no are no changes, we consider the splice user finalized */
41454149
if (!interactivetx_has_changes(ictx, ictx->desired_psbt)) {
41464150
splice_initiator_user_finalized(peer);

common/interactivetx.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,19 +227,35 @@ static char *send_next(const tal_t *ctx,
227227

228228
/* If this the shared channel input, we send funding txid in
229229
* in tlvs and do not send prevtx */
230+
if (ictx->shared_outpoint) {
231+
status_debug("ictx->shared_outpoint=%s",
232+
fmt_bitcoin_outpoint(tmpctx,
233+
ictx->shared_outpoint));
234+
}
235+
else {
236+
status_debug("ictx->shared_outpoint = NULL");
237+
}
238+
status_debug("point=%s", fmt_bitcoin_outpoint(tmpctx, &point));
239+
230240
if (ictx->shared_outpoint
231241
&& bitcoin_outpoint_eq(&point, ictx->shared_outpoint)) {
232-
struct tlv_tx_add_input_tlvs *tlvs = tal(tmpctx, struct tlv_tx_add_input_tlvs);
242+
struct tlv_tx_add_input_tlvs *tlvs = tlv_tx_add_input_tlvs_new(tmpctx);
233243
tlvs->shared_input_txid = tal_dup(tlvs,
234244
struct bitcoin_txid,
235245
&point.txid);
246+
status_debug("Adding shared input %s",
247+
tal_hexstr(ctx, &serial_id,
248+
sizeof(serial_id)));
236249
msg = towire_tx_add_input(NULL, cid, serial_id,
237250
NULL, in->input.index,
238251
in->input.sequence, tlvs);
239252
} else {
240253
msg = towire_tx_add_input(NULL, cid, serial_id,
241254
prevtx, in->input.index,
242255
in->input.sequence, NULL);
256+
status_debug("Adding splice input %s",
257+
tal_hexstr(ctx, &serial_id,
258+
sizeof(serial_id)));
243259
}
244260

245261
tal_arr_remove(&set->added_ins, 0);

0 commit comments

Comments
 (0)