| 3137 | } |
| 3138 | |
| 3139 | void htlcs_resubmit(struct lightningd *ld, |
| 3140 | struct htlc_in_map *unconnected_htlcs_in STEALS) |
| 3141 | { |
| 3142 | struct htlc_in *hin; |
| 3143 | struct htlc_in_map_iter ini; |
| 3144 | enum onion_wire badonion COMPILER_WANTS_INIT("gcc7.4.0 bad, 8.3 OK"); |
| 3145 | u8 *failmsg; |
| 3146 | |
| 3147 | /* Now retry any which were stuck. */ |
| 3148 | for (hin = htlc_in_map_first(unconnected_htlcs_in, &ini); |
| 3149 | hin; |
| 3150 | hin = htlc_in_map_next(unconnected_htlcs_in, &ini)) { |
| 3151 | if (hin->hstate != RCVD_ADD_ACK_REVOCATION) |
| 3152 | continue; |
| 3153 | |
| 3154 | log_unusual(hin->key.channel->log, |
| 3155 | "Replaying old unprocessed HTLC #%"PRIu64, |
| 3156 | hin->key.id); |
| 3157 | if (!peer_accepted_htlc(tmpctx, hin->key.channel, hin->key.id, |
| 3158 | true, &badonion, &failmsg)) { |
| 3159 | if (failmsg) |
| 3160 | local_fail_in_htlc(hin, failmsg); |
| 3161 | else |
| 3162 | local_fail_in_htlc_badonion(hin, badonion); |
| 3163 | } |
| 3164 | } |
| 3165 | |
| 3166 | /* Don't leak memory! */ |
| 3167 | tal_free(unconnected_htlcs_in); |
| 3168 | } |
| 3169 | |
| 3170 | static struct command_result *json_dev_ignore_htlcs(struct command *cmd, |
| 3171 | const char *buffer, |