* 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. */
| 1081 | * @param args Reference to vector of string args to modify. |
| 1082 | */ |
| 1083 | static 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 | |
| 1094 | static int CommandLineRPC(int argc, char *argv[]) |
| 1095 | { |
no test coverage detected