Skip to content

Commit

Permalink
channeld: don't assert that we're expecting revoke_and_ack.
Browse files Browse the repository at this point in the history
We can have it happen on reconnect due to fee changes; we should really
detect this case, but it's harmless to let it happen as a noop.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Nov 23, 2017
1 parent d28ee02 commit c3cb7f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 3 additions & 5 deletions channeld/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,11 +1114,9 @@ static struct io_plan *handle_peer_revoke_and_ack(struct io_conn *conn,
"Bad revoke_and_ack %s", tal_hex(msg, msg));
}

if (!channel_awaiting_revoke_and_ack(peer->channel))
peer_failed(io_conn_fd(peer->peer_conn),
&peer->pcs.cs,
&peer->channel_id,
"Unexpected revoke_and_ack");
/* FIXME: We can get unexpected revoke_and_ack due to retransmit; we
* should really detect this case and set
* channel_awaiting_revoke_and_ack; normally it will be true here. */

/* BOLT #2:
*
Expand Down
1 change: 0 additions & 1 deletion channeld/full_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,6 @@ bool channel_rcvd_revoke_and_ack(struct channel *channel,
if (change & HTLC_LOCAL_F_PENDING)
channel->changes_pending[LOCAL] = true;

assert(channel->awaiting_revoke_and_ack);
channel->awaiting_revoke_and_ack = false;

/* For funder, ack also means time to apply new feerate locally. */
Expand Down

0 comments on commit c3cb7f1

Please sign in to comment.