Browse Source

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>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
be5d945e97
  1. 6
      gossipd/gossip.c

6
gossipd/gossip.c

@ -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…
Cancel
Save