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

Function immediate_routing_failure

lightningd/pay.c:353–375  ·  view source on GitHub ↗

Return a struct routing_failure for an immediate failure * (returned directly from send_htlc_out). The returned * failure is allocated from the given context. */

Source from the content-addressed store, hash-verified

351 * (returned directly from send_htlc_out). The returned
352 * failure is allocated from the given context. */
353static struct routing_failure*
354immediate_routing_failure(const tal_t *ctx,
355 const struct lightningd *ld,
356 enum onion_wire failcode,
357 const struct short_channel_id *channel0,
358 const struct node_id *dstid)
359{
360 struct routing_failure *routing_failure;
361
362 assert(failcode);
363
364 routing_failure = tal(ctx, struct routing_failure);
365 routing_failure->erring_index = 0;
366 routing_failure->failcode = failcode;
367 routing_failure->erring_node =
368 tal_dup(routing_failure, struct node_id, &ld->id);
369 routing_failure->erring_channel =
370 tal_dup(routing_failure, struct short_channel_id, channel0);
371 routing_failure->channel_dir = node_id_idx(&ld->id, dstid);
372 routing_failure->msg = NULL;
373
374 return routing_failure;
375}
376
377/* Return a struct routing_failure for a local failure allocated
378 * from the given context. */

Callers 1

send_payment_coreFunction · 0.85

Calls 1

node_id_idxFunction · 0.85

Tested by

no test coverage detected