| 43 | |
| 44 | struct MiningConfig { |
| 45 | explicit MiningConfig(common::CommandLine &cmd) |
| 46 | : bytecoind_ip("127.0.0.1"), bytecoind_port(parameters::RPC_DEFAULT_PORT) { |
| 47 | if (const char *pa = cmd.get("--address", "Use --wallet-address instead")) |
| 48 | mining_address = pa; |
| 49 | if (const char *pa = cmd.get("--wallet-address")) |
| 50 | mining_address = pa; |
| 51 | if (const char *pa = cmd.get("--" CRYPTONOTE_NAME "d-address")) { |
| 52 | ewrap(common::parse_ip_address_and_port(pa, &bytecoind_ip, &bytecoind_port), |
| 53 | std::runtime_error("Command line option --" CRYPTONOTE_NAME "d-address has wrong format")); |
| 54 | } else |
| 55 | throw std::runtime_error("--" CRYPTONOTE_NAME "d-address=ip:port argument is mandatory"); |
| 56 | if (const char *pa = cmd.get("--limit")) |
| 57 | blocks_limit = common::integer_cast<size_t>(pa); |
| 58 | if (const char *pa = cmd.get("--boast")) |
| 59 | boast = pa; |
| 60 | if (const char *pa = cmd.get("--miner-secret")) { |
| 61 | if (!common::pod_from_hex(pa, &miner_secret)) |
| 62 | throw std::runtime_error("Miner Secret must be hash in hex"); |
| 63 | if (miner_secret == Hash{}) |
| 64 | throw std::runtime_error("Miner Secret must not be all zeroes"); |
| 65 | } |
| 66 | cm = cmd.get_bool("--cm"); |
| 67 | mm = cmd.get_bool("--mm"); |
| 68 | } |
| 69 | |
| 70 | std::string mining_address; |
| 71 | std::string bytecoind_ip; |
nothing calls this directly
no test coverage detected