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

Function peer_cpu_budget

connectd/multiplex.c:643–647  ·  view source on GitHub ↗

Each peer gets its "fair share" of our query-answering CPU. No floor: * that would let enough peers claim more than the whole budget between * them. A small share only slows a peer's queries, nothing else. */

Source from the content-addressed store, hash-verified

641 * that would let enough peers claim more than the whole budget between
642 * them. A small share only slows a peer's queries, nothing else. */
643static u64 peer_cpu_budget(const struct peer *peer)
644{
645 return peer->daemon->cpu_budget_usec_limit
646 / peer_htable_count(peer->daemon->peers);
647}
648
649/* usage/limit, in usec: e.g. usage == 3*limit means "3 seconds worth
650 * of quota burned in one go." */

Callers 2

maybe_gossip_msgFunction · 0.85
read_hdr_from_peerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected