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

Function send_onion

lightningd/pay.c:759–779  ·  view source on GitHub ↗

Returns failmsg on failure, tallocated off ctx */

Source from the content-addressed store, hash-verified

757
758/* Returns failmsg on failure, tallocated off ctx */
759static const u8 *send_onion(const tal_t *ctx, struct lightningd *ld,
760 const struct onionpacket *packet,
761 const struct route_hop *first_hop,
762 const struct amount_msat final_amount,
763 const struct sha256 *payment_hash,
764 const struct pubkey *blinding,
765 u64 partid,
766 u64 groupid,
767 struct channel *channel,
768 struct htlc_out **hout)
769{
770 const u8 *onion;
771 unsigned int base_expiry;
772
773 base_expiry = get_block_height(ld->topology) + 1;
774 onion = serialize_onionpacket(tmpctx, packet);
775 return send_htlc_out(ctx, channel, first_hop->amount,
776 base_expiry + first_hop->delay,
777 final_amount, payment_hash,
778 blinding, partid, groupid, onion, NULL, hout);
779}
780
781static struct command_result *check_offer_usage(struct command *cmd,
782 const struct sha256 *local_offer_id)

Callers 1

send_payment_coreFunction · 0.85

Calls 3

send_htlc_outFunction · 0.85
get_block_heightFunction · 0.70
serialize_onionpacketFunction · 0.50

Tested by

no test coverage detected