MCPcopy Create free account
hub / github.com/ElementsProject/lightning / htlcs_resubmit

Function htlcs_resubmit

lightningd/peer_htlcs.c:3139–3168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3137}
3138
3139void 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
3170static struct command_result *json_dev_ignore_htlcs(struct command *cmd,
3171 const char *buffer,

Callers 2

mainFunction · 0.70
test_htlc_crudFunction · 0.50

Calls 4

peer_accepted_htlcFunction · 0.85
tal_freeFunction · 0.85
local_fail_in_htlcFunction · 0.70

Tested by 1

test_htlc_crudFunction · 0.40