| 2740 | #endif /* COMPAT_V061 */ |
| 2741 | |
| 2742 | void htlcs_resubmit(struct lightningd *ld, |
| 2743 | struct htlc_in_map *unconnected_htlcs_in) |
| 2744 | { |
| 2745 | struct htlc_in *hin; |
| 2746 | struct htlc_in_map_iter ini; |
| 2747 | enum onion_wire badonion COMPILER_WANTS_INIT("gcc7.4.0 bad, 8.3 OK"); |
| 2748 | u8 *failmsg; |
| 2749 | |
| 2750 | /* Now retry any which were stuck. */ |
| 2751 | for (hin = htlc_in_map_first(unconnected_htlcs_in, &ini); |
| 2752 | hin; |
| 2753 | hin = htlc_in_map_next(unconnected_htlcs_in, &ini)) { |
| 2754 | if (hin->hstate != RCVD_ADD_ACK_REVOCATION) |
| 2755 | continue; |
| 2756 | |
| 2757 | log_unusual(hin->key.channel->log, |
| 2758 | "Replaying old unprocessed HTLC #%"PRIu64, |
| 2759 | hin->key.id); |
| 2760 | if (!peer_accepted_htlc(tmpctx, hin->key.channel, hin->key.id, |
| 2761 | true, &badonion, &failmsg)) { |
| 2762 | if (failmsg) |
| 2763 | local_fail_in_htlc(hin, failmsg); |
| 2764 | else |
| 2765 | local_fail_in_htlc_badonion(hin, badonion); |
| 2766 | } |
| 2767 | } |
| 2768 | |
| 2769 | /* Don't leak memory! */ |
| 2770 | htlc_in_map_clear(unconnected_htlcs_in); |
| 2771 | tal_free(unconnected_htlcs_in); |
| 2772 | } |
| 2773 | |
| 2774 | #if DEVELOPER |
| 2775 | static struct command_result *json_dev_ignore_htlcs(struct command *cmd, |