mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-08 07:34:20 +01:00
connectd: optimize case where peer doesn't want gossip.
LND and us send 0xFFFFFFFF to turn off gossip. LDK and Eclair don't seem to turn off gossip at all, but that's OK. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -632,7 +632,12 @@ static void handle_gossip_timestamp_filter_in(struct peer *peer, const u8 *msg)
|
||||
if (peer->gs.timestamp_max < peer->gs.timestamp_min)
|
||||
peer->gs.timestamp_max = UINT32_MAX;
|
||||
|
||||
peer->gs.off = 1;
|
||||
/* Optimization: they don't want anything. LND and us (at least),
|
||||
* both set first_timestamp to 0xFFFFFFFF to indicate that. */
|
||||
if (peer->gs.timestamp_min == UINT32_MAX)
|
||||
peer->gs.off = peer->daemon->gossip_store_end;
|
||||
else
|
||||
peer->gs.off = 1;
|
||||
|
||||
/* BOLT #7:
|
||||
* - MAY wait for the next outgoing gossip flush to send these.
|
||||
|
||||
Reference in New Issue
Block a user