mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
gossip: only send out gossip to non-local peers when we're supposed to.
This hook is called when the queue is empty; we should only send gossip according to the gossip timer. We're currently dribbling it out after every message, in violation of the spec. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
c8390ca403
commit
be5d945e97
@ -901,10 +901,16 @@ static struct io_plan *nonlocal_dump_gossip(struct io_conn *conn, struct daemon_
|
||||
/* Make sure we are not connected directly */
|
||||
assert(!peer->local);
|
||||
|
||||
/* Nothing to do if we're not gossiping */
|
||||
if (!peer->gossip_sync)
|
||||
return msg_queue_wait(conn, &peer->remote->out,
|
||||
daemon_conn_write_next, dc);
|
||||
|
||||
next = next_broadcast_message(peer->daemon->rstate->broadcasts,
|
||||
peer->broadcast_index);
|
||||
|
||||
if (!next) {
|
||||
peer->gossip_sync = false;
|
||||
return msg_queue_wait(conn, &peer->remote->out,
|
||||
daemon_conn_write_next, dc);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user