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

Function json_dev_rescan_outputs

wallet/walletrpc.c:546–571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546static struct command_result *json_dev_rescan_outputs(struct command *cmd,
547 const char *buffer,
548 const jsmntok_t *obj UNNEEDED,
549 const jsmntok_t *params)
550{
551 struct txo_rescan *rescan = tal(cmd, struct txo_rescan);
552
553 if (!param(cmd, buffer, params, NULL))
554 return command_param_failed();
555
556 rescan->response = json_stream_success(cmd);
557 rescan->cmd = cmd;
558
559 /* Open the outputs structure so we can incrementally add results */
560 json_array_start(rescan->response, "outputs");
561 rescan->utxos = wallet_get_all_utxos(rescan, cmd->ld->wallet);
562 if (tal_count(rescan->utxos) == 0) {
563 json_array_end(rescan->response);
564 return command_success(cmd, rescan->response);
565 }
566 bitcoind_getutxout(rescan, cmd->ld->topology->bitcoind,
567 &rescan->utxos[0]->outpoint,
568 process_utxo_result,
569 rescan);
570 return command_still_pending(cmd);
571}
572
573static const struct json_command dev_rescan_output_command = {
574 "dev-rescan-outputs",

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected