status: suppress status_trace/status_debug messages if queue too long.

We can be spammy, which is good for tests, but bad for our simple message queue.
This avoids breaking our tests but also avoid the worst case (1M entries and counting!)
for gossip status messages in the case where we're syncing a large peer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-05-02 10:25:17 +09:30
committed by Christian Decker
parent e3bac6c165
commit ec658c1f89
5 changed files with 39 additions and 0 deletions

View File

@@ -22,6 +22,11 @@ static void do_enqueue(struct msg_queue *q, const u8 *add TAKES)
io_wake(q);
}
size_t msg_queue_length(const struct msg_queue *q)
{
return tal_count(q->q);
}
void msg_enqueue(struct msg_queue *q, const u8 *add)
{
assert(fromwire_peektype(add) != MSG_PASS_FD);