channeld: fix conditions under which we can send a channel update.

The condition in send_channel_update is wrong: it needs to match the
conditions under which we send announcements.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-05-18 15:19:14 +09:30 committed by Christian Decker
parent c546b1bbb6
commit 00d4c04208

View File

@ -349,9 +349,9 @@ static void send_channel_update(struct peer *peer, bool peer_too,
assert(disable_flag == 0 || disable_flag == ROUTING_FLAGS_DISABLED);
/* If we don't have funding_locked both sides, we can't have told
* gossipd or created update. */
if (!peer->funding_locked[LOCAL] || !peer->funding_locked[REMOTE])
/* Only send an update if we sent a temporary or real announcement */
if (!peer->sent_temporary_announce
&& !(peer->have_sigs[LOCAL] && peer->have_sigs[REMOTE]))
return;
msg = create_channel_update(tmpctx, peer, disable_flag);
@ -508,8 +508,8 @@ static void channel_announcement_negotiate(struct peer *peer)
* a local update */
if (!peer->announce_depth_reached) {
if (!peer->sent_temporary_announce) {
send_temporary_announcement(peer);
peer->sent_temporary_announce = true;
send_temporary_announcement(peer);
}
return;
}