gossipd: make use of new ratelimit bit in gossip_store length mask

routing.c now flags rate-limited gossip as it enters the gossip_store but
makes use of it in updating the routing graph. Flagged gossip is not
rebroadcast to gossip peers.

Changelog-Changed: gossipd: now accepts spam gossip, but squelches it for
peers.
This commit is contained in:
Alex Myers
2022-05-04 08:48:59 -05:00
committed by Rusty Russell
parent cbafc0fa33
commit 9dc794dba8
7 changed files with 41 additions and 23 deletions

View File

@@ -12,8 +12,10 @@ import struct
GOSSIP_STORE_VERSIONS = [0x09, 0x0a]
GOSSIP_STORE_LEN_DELETED_BIT = 0x80000000
GOSSIP_STORE_LEN_PUSH_BIT = 0x40000000
GOSSIP_STORE_LEN_RATELIMIT_BIT = 0x20000000
GOSSIP_STORE_LEN_MASK = (~(GOSSIP_STORE_LEN_PUSH_BIT
| GOSSIP_STORE_LEN_DELETED_BIT))
| GOSSIP_STORE_LEN_DELETED_BIT
| GOSSIP_STORE_LEN_RATELIMIT_BIT))
# These duplicate constants in lightning/gossipd/gossip_store_wiregen.h
WIRE_GOSSIP_STORE_PRIVATE_CHANNEL = 4104