Skip to content

Commit

Permalink
splice: Add more verbose reestablish debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ddustin committed Feb 19, 2024
1 parent 0cc0b6f commit 6bdafb9
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 6bdafb9

Please sign in to comment.