diff --git a/channeld/channel.c b/channeld/channel.c index 3f086a386..bd4ce2cca 100644 --- a/channeld/channel.c +++ b/channeld/channel.c @@ -1604,6 +1604,9 @@ static void resend_commitment(struct peer *peer, const struct changed_htlc *last commit_sigs->htlc_sigs); msg_enqueue(&peer->peer_out, take(msg)); tal_free(commit_sigs); + + /* Now we have to wait for revoke_and_ack */ + peer->channel->awaiting_revoke_and_ack = true; } static void peer_reconnect(struct peer *peer) diff --git a/channeld/full_channel.c b/channeld/full_channel.c index b7fefa82c..fa022fac0 100644 --- a/channeld/full_channel.c +++ b/channeld/full_channel.c @@ -862,21 +862,6 @@ bool channel_sending_revoke_and_ack(struct channel *channel) return channel->changes_pending[REMOTE]; } -static bool htlc_awaiting_revoke_and_ack(const struct htlc *h) -{ - const enum htlc_state states[] = { SENT_ADD_COMMIT, - SENT_REMOVE_ACK_COMMIT, - SENT_ADD_ACK_COMMIT, - SENT_REMOVE_COMMIT }; - - for (size_t i = 0; i < ARRAY_SIZE(states); i++) { - if (h->state == states[i]) { - return true; - } - } - return false; -} - bool channel_awaiting_revoke_and_ack(const struct channel *channel) { return channel->awaiting_revoke_and_ack; @@ -985,9 +970,6 @@ bool channel_force_htlcs(struct channel *channel, ? "out" : "in", htlcs[i].id, e); return false; } - - if (htlc_awaiting_revoke_and_ack(htlc)) - channel->awaiting_revoke_and_ack = true; } for (i = 0; i < tal_count(fulfilled); i++) {