Browse Source

channeld: don't send ANNOUNCEMENT_SIGNATURES if we've send shutdown.

Our closingd doesn't handle it:

lightningd(2968): 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 chan #1:
 Peer permanent failure in CLOSINGD_SIGEXCHANGE: lightning_closingd: sent ERROR Expected closing_signed:
 0103ff54517293892ec3f214f2343c54cbfbf24aa6ffb8d5585d3bc1b543eae0a272000067000001000146390e0c043c777226927eacd2186a03f064e4bdc30f891cb6e4990af49967d34b338755e99d728987e3d49227815e17f3ab40092434a59e33548e870071176d26d19a4e4d8f7715c13ac2d6bf3238608a1ccf9afd91f774d84d170d9edddebf7460c54d49bd6cd81410bc3eeeba2b7278b1b5f7e748d77d793f31086847d582

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
99bba2a23c
  1. 21
      channeld/channel.c

21
channeld/channel.c

@ -473,6 +473,10 @@ static void handle_peer_funding_locked(struct peer *peer, const u8 *msg)
if (peer->funding_locked[REMOTE])
return;
/* Too late, we're shutting down! */
if (peer->shutdown_sent[LOCAL])
return;
peer->old_remote_per_commit = peer->remote_per_commit;
if (!fromwire_funding_locked(msg, &chanid,
&peer->remote_per_commit))
@ -1930,6 +1934,10 @@ static void handle_funding_locked(struct peer *peer, const u8 *msg)
&peer->short_channel_ids[LOCAL]))
master_badmsg(WIRE_CHANNEL_FUNDING_LOCKED, msg);
/* Too late, we're shutting down! */
if (peer->shutdown_sent[LOCAL])
return;
per_commit_point(&peer->shaseed,
&next_per_commit_point, peer->next_index[LOCAL]);
@ -1954,6 +1962,10 @@ static void handle_funding_announce_depth(struct peer *peer)
if (peer->announce_depth_reached)
return;
/* Too late, we're shutting down! */
if (peer->shutdown_sent[LOCAL])
return;
peer->announce_depth_reached = true;
send_announcement_signatures(peer);
@ -2531,9 +2543,12 @@ static void init_channel(struct peer *peer)
if (funding_signed)
enqueue_peer_msg(peer, take(funding_signed));
/* It's possible that we died previously before doing these. */
send_temporary_announcement(peer);
send_announcement_signatures(peer);
/* Don't send if we're shutting down */
if (!peer->shutdown_sent[LOCAL]) {
/* It's possible that we died previously before doing these. */
send_temporary_announcement(peer);
send_announcement_signatures(peer);
}
billboard_update(peer);
tal_free(msg);

Loading…
Cancel
Save