From b67fde8106bf0185768a4887295a6755e42e4b43 Mon Sep 17 00:00:00 2001 From: Greg Sanders Date: Fri, 6 Jan 2023 12:06:09 -0500 Subject: [PATCH] Fix 'extreme cases' logging of many commit timer failures --- channeld/channeld.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index a86cc8350..70f4e9700 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -1245,6 +1245,9 @@ static void send_commit(struct peer *peer) peer->commit_timer = NULL; start_commit_timer(peer); return; + } else { + /* We can advance; wipe attempts */ + peer->commit_timer_attempts = 0; } /* BOLT #2: @@ -1399,7 +1402,6 @@ static void start_commit_timer(struct peer *peer) if (peer->commit_timer) return; - peer->commit_timer_attempts = 0; peer->commit_timer = new_reltimer(&peer->timers, peer, time_from_msec(peer->commit_msec), send_commit, peer); @@ -3985,6 +3987,7 @@ int main(int argc, char *argv[]) peer->shutdown_wrong_funding = NULL; peer->last_update_timestamp = 0; peer->last_empty_commitment = 0; + peer->commit_timer_attempts = 0; #if EXPERIMENTAL_FEATURES peer->stfu = false; peer->stfu_sent[LOCAL] = peer->stfu_sent[REMOTE] = false;