mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
connectd: restore gossip filter aging.
When we moved gossip filtering to connectd, this aging got lost. Without this, we hit the 10,000 entry limit before expiring full gossip anti-echo cache. This is under 1M in allocations per peer, but in DEVELOPER mode each allocation includes adds 3 notifiers (32 bytes each) and a backtrace child (40 + 40 + 256 bytes), making it almost 10MB per peer, plus allocation overhead. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Fixed: connectd: large memory usage with many peers fixed.
This commit is contained in:
@@ -344,6 +344,9 @@ static struct io_plan *encrypt_and_send(struct peer *peer,
|
|||||||
/* Kicks off write_to_peer() to look for more gossip to send from store */
|
/* Kicks off write_to_peer() to look for more gossip to send from store */
|
||||||
static void wake_gossip(struct peer *peer)
|
static void wake_gossip(struct peer *peer)
|
||||||
{
|
{
|
||||||
|
/* Don't remember sent per-peer gossip forever. */
|
||||||
|
gossip_rcvd_filter_age(peer->gs.grf);
|
||||||
|
|
||||||
peer->gs.active = IFDEV(!peer->daemon->dev_suppress_gossip, true);
|
peer->gs.active = IFDEV(!peer->daemon->dev_suppress_gossip, true);
|
||||||
io_wake(peer->peer_outq);
|
io_wake(peer->peer_outq);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user