Return a struct routing_failure for an immediate failure * (returned directly from send_htlc_out). The returned * failure is allocated from the given context. */
| 381 | * (returned directly from send_htlc_out). The returned |
| 382 | * failure is allocated from the given context. */ |
| 383 | static struct routing_failure* |
| 384 | immediate_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. */ |
no test coverage detected