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

Function json_dev_rawrequest

plugins/fetchinvoice.c:1769–1800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1767}
1768
1769struct command_result *json_dev_rawrequest(struct command *cmd,
1770 const char *buffer,
1771 const jsmntok_t *params)
1772{
1773 struct sent *sent = tal(cmd, struct sent);
1774 u32 *timeout;
1775 struct pubkey *node_id;
1776 struct tlv_onionmsg_tlv *payload;
1777
1778 if (!param(cmd, buffer, params,
1779 p_req("invreq", param_raw_invreq, &sent->invreq),
1780 p_req("nodeid", param_pubkey, &node_id),
1781 p_opt_def("timeout", param_number, &timeout, 60),
1782 NULL))
1783 return command_param_failed();
1784
1785 /* This is how long we'll wait for a reply for. */
1786 sent->wait_timeout = *timeout;
1787 sent->cmd = cmd;
1788 sent->offer = NULL;
1789 sent->dev_path_use_scidd = NULL;
1790 sent->dev_reply_path = NULL;
1791 sent->their_paths = NULL;
1792 sent->direct_dest = node_id;
1793 sent->issuer_key = node_id;
1794
1795 payload = tlv_onionmsg_tlv_new(sent);
1796 payload->invoice_request = tal_arr(payload, u8, 0);
1797 towire_tlv_invoice_request(&payload->invoice_request, sent->invreq);
1798
1799 return send_message(cmd, sent, true, payload, sendonionmsg_done);
1800}

Callers

nothing calls this directly

Calls 4

send_messageFunction · 0.85
command_param_failedFunction · 0.70
paramFunction · 0.50

Tested by

no test coverage detected