@ -423,8 +423,7 @@ static struct io_plan *init_new_peer(struct io_conn *conn,
static struct io_plan * owner_msg_in ( struct io_conn * conn ,
static struct io_plan * owner_msg_in ( struct io_conn * conn ,
struct daemon_conn * dc ) ;
struct daemon_conn * dc ) ;
static struct io_plan * nonlocal_dump_gossip ( struct io_conn * conn ,
static bool nonlocal_dump_gossip ( struct io_conn * conn , struct daemon_conn * dc ) ;
struct daemon_conn * dc ) ;
/* Create a node_announcement with the given signature. It may be NULL
/* Create a node_announcement with the given signature. It may be NULL
* in the case we need to create a provisional announcement for the
* in the case we need to create a provisional announcement for the
@ -914,7 +913,7 @@ static bool send_peer_with_fds(struct peer *peer, const u8 *msg)
*
*
* Registered as ` msg_queue_cleared_cb ` by the ` peer - > remote ` .
* Registered as ` msg_queue_cleared_cb ` by the ` peer - > remote ` .
*/
*/
static struct io_plan * nonlocal_dump_gossip ( struct io_conn * conn , struct daemon_conn * dc )
static bool nonlocal_dump_gossip ( struct io_conn * conn , struct daemon_conn * dc )
{
{
struct queued_message * next ;
struct queued_message * next ;
struct peer * peer = dc - > ctx ;
struct peer * peer = dc - > ctx ;
@ -925,22 +924,20 @@ static struct io_plan *nonlocal_dump_gossip(struct io_conn *conn, struct daemon_
/* Nothing to do if we're not gossiping */
/* Nothing to do if we're not gossiping */
if ( ! peer - > gossip_sync )
if ( ! peer - > gossip_sync )
return msg_queue_wait ( conn , & peer - > remote - > out ,
return false ;
daemon_conn_write_next , dc ) ;
next = next_broadcast_message ( peer - > daemon - > rstate - > broadcasts ,
next = next_broadcast_message ( peer - > daemon - > rstate - > broadcasts ,
& peer - > broadcast_index ) ;
& peer - > broadcast_index ) ;
if ( ! next ) {
if ( ! next ) {
peer - > gossip_sync = false ;
peer - > gossip_sync = false ;
return msg_queue_wait ( conn , & peer - > remote - > out ,
return false ;
daemon_conn_write_next , dc ) ;
} else {
} else {
u8 * msg = towire_gossip_send_gossip ( conn ,
u8 * msg = towire_gossip_send_gossip ( conn ,
peer - > broadcast_index ,
peer - > broadcast_index ,
next - > payload ) ;
next - > payload ) ;
return io_write_wire ( conn , take ( msg ) ,
daemon_conn_send ( peer - > remote , take ( msg ) ) ;
nonlocal_dump_gossip , dc ) ;
return true ;
}
}
}
}