Fix 'extreme cases' logging of many commit timer failures

This commit is contained in:
Greg Sanders 2023-01-06 12:06:09 -05:00 committed by Alex Myers
parent 1e951a9479
commit b67fde8106

View file

@ -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;