Browse Source

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>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
00d4c04208
  1. 8
      channeld/channel.c

8
channeld/channel.c

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

Loading…
Cancel
Save