MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / SetGenerateToAddressArgs

Function SetGenerateToAddressArgs

src/bitcoin-cli.cpp:1540–1549  ·  view source on GitHub ↗

* Check bounds and set up args for RPC generatetoaddress params: nblocks, address, maxtries. * @param[in] address Reference to const string address to insert into the args. * @param args Reference to vector of string args to modify. */

Source from the content-addressed store, hash-verified

1538 * @param args Reference to vector of string args to modify.
1539 */
1540static void SetGenerateToAddressArgs(const std::string& address, std::vector<std::string>& args)
1541{
1542 if (args.size() > 2) throw std::runtime_error("too many arguments (maximum 2 for nblocks and maxtries)");
1543 if (args.size() == 0) {
1544 args.emplace_back(DEFAULT_NBLOCKS);
1545 } else if (args.at(0) == "0") {
1546 throw std::runtime_error("the first argument (number of blocks to generate, default: " + DEFAULT_NBLOCKS + ") must be an integer value greater than zero");
1547 }
1548 args.emplace(args.begin() + 1, address);
1549}
1550
1551static int CommandLineRPC(int argc, char *argv[])
1552{

Callers 1

CommandLineRPCFunction · 0.85

Calls 5

emplaceMethod · 0.80
sizeMethod · 0.45
emplace_backMethod · 0.45
atMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected