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

Function json_dev_rawrequest

plugins/fetchinvoice.c:1678–1709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1676}
1677
1678struct command_result *json_dev_rawrequest(struct command *cmd,
1679 const char *buffer,
1680 const jsmntok_t *params)
1681{
1682 struct sent *sent = tal(cmd, struct sent);
1683 u32 *timeout;
1684 struct pubkey *node_id;
1685 struct tlv_onionmsg_tlv *payload;
1686
1687 if (!param(cmd, buffer, params,
1688 p_req("invreq", param_raw_invreq, &sent->invreq),
1689 p_req("nodeid", param_pubkey, &node_id),
1690 p_opt_def("timeout", param_number, &timeout, 60),
1691 NULL))
1692 return command_param_failed();
1693
1694 /* This is how long we'll wait for a reply for. */
1695 sent->wait_timeout = *timeout;
1696 sent->cmd = cmd;
1697 sent->offer = NULL;
1698 sent->dev_path_use_scidd = NULL;
1699 sent->dev_reply_path = NULL;
1700 sent->their_paths = NULL;
1701 sent->direct_dest = node_id;
1702 sent->issuer_key = node_id;
1703
1704 payload = tlv_onionmsg_tlv_new(sent);
1705 payload->invoice_request = tal_arr(payload, u8, 0);
1706 towire_tlv_invoice_request(&payload->invoice_request, sent->invreq);
1707
1708 return send_message(cmd, sent, true, payload, sendonionmsg_done);
1709}

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