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

Function json_dev_rescan_outputs

wallet/walletrpc.c:426–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424}
425
426static struct command_result *json_dev_rescan_outputs(struct command *cmd,
427 const char *buffer,
428 const jsmntok_t *obj UNNEEDED,
429 const jsmntok_t *params)
430{
431 struct txo_rescan *rescan = tal(cmd, struct txo_rescan);
432
433 if (!param(cmd, buffer, params, NULL))
434 return command_param_failed();
435
436 rescan->response = json_stream_success(cmd);
437 rescan->cmd = cmd;
438
439 /* Open the outputs structure so we can incrementally add results */
440 json_array_start(rescan->response, "outputs");
441 rescan->utxos = wallet_get_utxos(rescan, cmd->ld->wallet, OUTPUT_STATE_ANY);
442 if (tal_count(rescan->utxos) == 0) {
443 json_array_end(rescan->response);
444 return command_success(cmd, rescan->response);
445 }
446 bitcoind_getutxout(cmd->ld->topology->bitcoind,
447 &rescan->utxos[0]->outpoint,
448 process_utxo_result,
449 rescan);
450 return command_still_pending(cmd);
451}
452
453static const struct json_command dev_rescan_output_command = {
454 "dev-rescan-outputs",

Callers

nothing calls this directly

Calls 8

wallet_get_utxosFunction · 0.85
paramFunction · 0.50
command_param_failedFunction · 0.50
json_stream_successFunction · 0.50
json_array_startFunction · 0.50
json_array_endFunction · 0.50
command_successFunction · 0.50
command_still_pendingFunction · 0.50

Tested by

no test coverage detected