Returns failmsg on failure, tallocated off ctx */
| 770 | |
| 771 | /* Returns failmsg on failure, tallocated off ctx */ |
| 772 | static const u8 *send_onion(const tal_t *ctx, struct lightningd *ld, |
| 773 | const struct onionpacket *packet, |
| 774 | const struct route_hop *first_hop, |
| 775 | const struct amount_msat final_amount, |
| 776 | const struct sha256 *payment_hash, |
| 777 | const struct pubkey *path_key, |
| 778 | u64 partid, |
| 779 | u64 groupid, |
| 780 | struct channel *channel, |
| 781 | struct htlc_out **hout) |
| 782 | { |
| 783 | const u8 *onion; |
| 784 | unsigned int base_expiry; |
| 785 | |
| 786 | /* Use bitcoind's block height, even if we're behind in processing */ |
| 787 | base_expiry = get_network_blockheight(ld->topology) + 1; |
| 788 | onion = serialize_onionpacket(tmpctx, packet); |
| 789 | return send_htlc_out(ctx, channel, first_hop->amount, |
| 790 | base_expiry + first_hop->delay, |
| 791 | final_amount, payment_hash, |
| 792 | path_key, NULL, partid, groupid, onion, NULL, hout); |
| 793 | } |
| 794 | |
| 795 | static struct command_result *check_invoice_request_usage(struct command *cmd, |
| 796 | const struct sha256 *local_invreq_id) |
no test coverage detected