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

Function send_onion

lightningd/pay.c:772–793  ·  view source on GitHub ↗

Returns failmsg on failure, tallocated off ctx */

Source from the content-addressed store, hash-verified

770
771/* Returns failmsg on failure, tallocated off ctx */
772static 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
795static struct command_result *check_invoice_request_usage(struct command *cmd,
796 const struct sha256 *local_invreq_id)

Callers 1

send_payment_coreFunction · 0.85

Calls 3

serialize_onionpacketFunction · 0.85
send_htlc_outFunction · 0.85
get_network_blockheightFunction · 0.70

Tested by

no test coverage detected