From 1a827cc519cc8990c0632d5b802f7dff1efe4492 Mon Sep 17 00:00:00 2001 From: Dusty Daemon Date: Mon, 19 Feb 2024 15:08:51 -0500 Subject: [PATCH] splice: Add more verbose reestablish debug logging --- channeld/channeld.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index 2988e7249741..d2efb32ff83e 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -1165,8 +1165,10 @@ static u8 *send_commit_part(const tal_t *ctx, if (feature_negotiated(peer->our_features, peer->their_features, OPT_EXPERIMENTAL_SPLICE)) { - status_debug("send_commit_part(splice: %d, remote_splice: %d)", - (int)splice_amnt, (int)remote_splice_amnt); + status_debug("send_commit_part(splice: %d, remote_splice: %d," + " index: %"PRIu64")", + (int)splice_amnt, (int)remote_splice_amnt, + remote_index); cs_tlv->splice_info = tal(cs_tlv, struct channel_id); derive_channel_id(cs_tlv->splice_info, funding); @@ -1886,8 +1888,9 @@ static struct commitsig_info *handle_peer_commit_sig(struct peer *peer, const struct commitsig **commitsigs; int remote_anchor_outnum; - status_debug("handle_peer_commit_sig(splice: %d, remote_splice: %d)", - (int)splice_amnt, (int)remote_splice_amnt); + status_debug("handle_peer_commit_sig(splice: %d, remote_splice: %d," + " index: %"PRIu64")", + (int)splice_amnt, (int)remote_splice_amnt, local_index); struct tlv_commitment_signed_tlvs *cs_tlv = tlv_commitment_signed_tlvs_new(tmpctx); @@ -2766,8 +2769,11 @@ static struct commitsig *interactive_send_commitments(struct peer *peer, if (do_i_sign_first(peer, psbt, our_role, inflight->force_sign_first) && send_commitments) { - status_debug("Splice %s: we commit first", - our_role == TX_INITIATOR ? "initiator" : "accepter"); + status_debug("Splice %s: we commit first;" + " next_index_local:%"PRIu64";" + " next_index_remote:%"PRIu64, + our_role == TX_INITIATOR ? "initiator" : "accepter", + next_index_local, next_index_remote); peer_write(peer->pps, send_commit_part(tmpctx, peer, @@ -2794,6 +2800,12 @@ static struct commitsig *interactive_send_commitments(struct peer *peer, if (msg_received) *msg_received = msg; + status_debug("Splice %s: we recv commit;" + " next_index_local:%"PRIu64";" + " next_index_remote:%"PRIu64, + our_role == TX_INITIATOR ? "initiator" : "accepter", + next_index_local, next_index_remote); + /* Funding counts as 0th commit so we do inflight_index + 1 */ if (fromwire_peektype(msg) == WIRE_COMMITMENT_SIGNED) { get_per_commitment_point(next_index_local - 1, @@ -2813,8 +2825,11 @@ static struct commitsig *interactive_send_commitments(struct peer *peer, if (!do_i_sign_first(peer, psbt, our_role, inflight->force_sign_first) && send_commitments) { - status_debug("Splice %s: we commit second", - our_role == TX_INITIATOR ? "initiator" : "accepter"); + status_debug("Splice %s: we commit second;" + " next_index_local:%"PRIu64";" + " next_index_remote:%"PRIu64, + our_role == TX_INITIATOR ? "initiator" : "accepter", + next_index_local, next_index_remote); peer_write(peer->pps, send_commit_part(tmpctx, peer,