Skip to content

Commit

Permalink
channeld: don't send update_fee after shutdown.
Browse files Browse the repository at this point in the history
See: lightning/bolts#367
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Feb 2, 2018
1 parent d1ab2e0 commit 5971861
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions channeld/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,19 @@ static void send_commit(struct peer *peer)
return;
}

/* BOLT #2:
*
* - if no HTLCs remain in either commitment transaction:
* - MUST NOT send any `update` message after a `shutdown`.
*/
if (peer->shutdown_sent[LOCAL] && !channel_has_htlcs(peer->channel)) {
status_trace("Can't send commit: final shutdown phase");

peer->commit_timer = NULL;
tal_free(tmpctx);
return;
}

/* If we wanted to update fees, do it now. */
if (peer->channel->funder == LOCAL
&& peer->desired_feerate != channel_feerate(peer->channel, REMOTE)) {
Expand Down

0 comments on commit 5971861

Please sign in to comment.