* 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. */
| 1538 | * @param args Reference to vector of string args to modify. |
| 1539 | */ |
| 1540 | static 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 | |
| 1551 | static int CommandLineRPC(int argc, char *argv[]) |
| 1552 | { |
no test coverage detected