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

Function immediate_routing_failure

lightningd/pay.c:383–405  ·  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

381 * (returned directly from send_htlc_out). The returned
382 * failure is allocated from the given context. */
383static struct routing_failure*
384immediate_routing_failure(const tal_t *ctx,
385 const struct lightningd *ld,
386 enum onion_wire failcode,
387 struct short_channel_id channel0,
388 const struct node_id *dstid)
389{
390 struct routing_failure *routing_failure;
391
392 assert(failcode);
393
394 routing_failure = tal(ctx, struct routing_failure);
395 routing_failure->erring_index = 0;
396 routing_failure->failcode = failcode;
397 routing_failure->erring_node =
398 tal_dup(routing_failure, struct node_id, &ld->our_nodeid);
399 routing_failure->erring_channel =
400 tal_dup(routing_failure, struct short_channel_id, &channel0);
401 routing_failure->channel_dir = node_id_idx(&ld->our_nodeid, dstid);
402 routing_failure->msg = NULL;
403
404 return routing_failure;
405}
406
407/* Return a struct routing_failure for a local failure allocated
408 * from the given context. */

Callers 1

send_payment_coreFunction · 0.85

Calls 1

node_id_idxFunction · 0.85

Tested by

no test coverage detected