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

Function json_spamcommand

tests/plugins/test_libplugin.c:218–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218static struct command_result *json_spamcommand(struct command *cmd,
219 const char *buf,
220 const jsmntok_t *params)
221{
222 u64 *iterations;
223 struct request_batch *batch;
224
225 if (!param(cmd, buf, params,
226 p_req("iterations", param_u64, &iterations),
227 NULL))
228 return command_param_failed();
229
230 batch = request_batch_new(cmd, NULL, spam_errcb, spam_done, NULL);
231 for (size_t i = 0; i < *iterations; i++) {
232 struct out_req *req = add_to_batch(cmd, batch, "batching");
233 json_add_bool(req->js, "enable", true);
234 send_outreq(req);
235 }
236 return batch_done(cmd, batch);
237}
238
239static struct command_result *json_spamlistcommand(struct command *cmd,
240 const char *buf,

Callers

nothing calls this directly

Calls 6

add_to_batchFunction · 0.85
json_add_boolFunction · 0.85
batch_doneFunction · 0.85
paramFunction · 0.50
command_param_failedFunction · 0.50
send_outreqFunction · 0.50

Tested by

no test coverage detected