Skip to content

Commit f68908b

Browse files
committed
channeld: don't spin trying to send commitment while waiting.
We would sleep for 10msec (default) and try again, spamming the logs every second. But we're waiting for revoke_and_ack, and that handler already sets off the timer, so there's no need to spin at all! Fixes: #6077 Changelog-Fixed: `channeld`: no longer spin and spam logs when waiting for revoke_and_ack. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent fca6211 commit f68908b

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

channeld/channeld.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ struct peer {
9898

9999
struct timers timers;
100100
struct oneshot *commit_timer;
101-
u64 commit_timer_attempts;
102101
u32 commit_msec;
103102

104103
/* The feerate we want. */
@@ -1234,20 +1233,11 @@ static void send_commit(struct peer *peer)
12341233
if (peer->revocations_received != peer->next_index[REMOTE] - 1) {
12351234
assert(peer->revocations_received
12361235
== peer->next_index[REMOTE] - 2);
1237-
peer->commit_timer_attempts++;
1238-
/* Only report this in extreme cases */
1239-
if (peer->commit_timer_attempts % 100 == 0)
1240-
status_debug("Can't send commit:"
1241-
" waiting for revoke_and_ack with %"
1242-
PRIu64" attempts",
1243-
peer->commit_timer_attempts);
1244-
/* Mark this as done and try again. */
1236+
status_debug("Can't send commit: waiting for revoke_and_ack");
1237+
/* Mark this as done: handle_peer_revoke_and_ack will
1238+
* restart. */
12451239
peer->commit_timer = NULL;
1246-
start_commit_timer(peer);
12471240
return;
1248-
} else {
1249-
/* We can advance; wipe attempts */
1250-
peer->commit_timer_attempts = 0;
12511241
}
12521242

12531243
/* BOLT #2:
@@ -3989,7 +3979,6 @@ int main(int argc, char *argv[])
39893979
peer->shutdown_wrong_funding = NULL;
39903980
peer->last_update_timestamp = 0;
39913981
peer->last_empty_commitment = 0;
3992-
peer->commit_timer_attempts = 0;
39933982
#if EXPERIMENTAL_FEATURES
39943983
peer->stfu = false;
39953984
peer->stfu_sent[LOCAL] = peer->stfu_sent[REMOTE] = false;

0 commit comments

Comments
 (0)