From 74107ff1eaed82de09ed584659805bb9373effaf Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 31 Aug 2016 14:51:43 +0930 Subject: [PATCH] peer: resend failures on restart/reconnect. If we've not relayed a failure yet (ie. we relayed it instantly, but it wasn't confirmed), we need to redo it. Signed-off-by: Rusty Russell --- daemon/peer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/daemon/peer.c b/daemon/peer.c index b2fdbd008..560ea73ac 100644 --- a/daemon/peer.c +++ b/daemon/peer.c @@ -650,11 +650,13 @@ static void retry_all_routing(struct peer *restarted_peer) for (h = htlc_map_first(&restarted_peer->htlcs, &it); h; h = htlc_map_next(&restarted_peer->htlcs, &it)) { - if (h->r && h->state == RCVD_ADD_ACK_REVOCATION) + if (h->state != RCVD_ADD_ACK_REVOCATION) + continue; + if (h->r) command_htlc_fulfill(restarted_peer, h); + else if (h->fail) + command_htlc_fail(restarted_peer, h); } - - /* FIXME: Also any HTLCs which were failed! */ } static void adjust_cstate_side(struct channel_state *cstate,