gossipd: allow faster updating, 2 per day, before ratelimiting.

This limit applies to both node_announcements (which we now send 1 per
day), and channel_updates; I've had reports of LND nodes going down
daily for database compation, so they end up ratelimited.

Changelog-Protocol: We now allow two channel_updates or node_announcements per day, up from 1.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-03-04 11:18:18 +10:30
parent 93c00cc07d
commit a3696f0469

View file

@ -33,10 +33,10 @@ struct pending_node_announce {
struct peer *peer_softref;
};
/* We consider a reasonable gossip rate to be 1 per day, with burst of
/* We consider a reasonable gossip rate to be 2 per day, with burst of
* 4 per day. So we use a granularity of one hour. */
#define TOKENS_PER_MSG 24
#define TOKEN_MAX (24 * 4)
#define TOKENS_PER_MSG 12
#define TOKEN_MAX (12 * 4)
static u8 update_tokens(const struct routing_state *rstate,
u8 tokens, u32 prev_timestamp, u32 new_timestamp)