mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-09 09:04:25 +01:00
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:
committed by
Christian Decker
parent
e3bac6c165
commit
ec658c1f89
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user