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

Function json_dev_rescan_outputs

wallet/walletrpc.c:545–570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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