MCPcopy Create free account
hub / github.com/ElementsProject/elements / SetGenerateToAddressArgs

Function SetGenerateToAddressArgs

src/bitcoin-cli.cpp:1083–1092  ·  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

1081 * @param args Reference to vector of string args to modify.
1082 */
1083static void SetGenerateToAddressArgs(const std::string& address, std::vector<std::string>& args)
1084{
1085 if (args.size() > 2) throw std::runtime_error("too many arguments (maximum 2 for nblocks and maxtries)");
1086 if (args.size() == 0) {
1087 args.emplace_back(DEFAULT_NBLOCKS);
1088 } else if (args.at(0) == "0") {
1089 throw std::runtime_error("the first argument (number of blocks to generate, default: " + DEFAULT_NBLOCKS + ") must be an integer value greater than zero");
1090 }
1091 args.emplace(args.begin() + 1, address);
1092}
1093
1094static int CommandLineRPC(int argc, char *argv[])
1095{

Callers 1

CommandLineRPCFunction · 0.85

Calls 3

emplace_backMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected