MCPcopy Create free account
hub / github.com/ElementsProject/lightning / ratelimit

Function ratelimit

gossipd/routing.c:65–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65static bool ratelimit(const struct routing_state *rstate,
66 u8 *tokens, u32 prev_timestamp, u32 new_timestamp)
67{
68 *tokens = update_tokens(rstate, *tokens, prev_timestamp, new_timestamp);
69
70 /* Now, if we can afford it, pass this message. */
71 if (*tokens >= TOKENS_PER_MSG) {
72 *tokens -= TOKENS_PER_MSG;
73 return true;
74 }
75 return false;
76}
77
78static const struct node_id *
79pending_node_announce_keyof(const struct pending_node_announce *a)

Callers 2

Calls 1

update_tokensFunction · 0.85

Tested by

no test coverage detected