MCPcopy Create free account
hub / github.com/bcndev/bytecoin / MiningConfig

Method MiningConfig

src/main_miner.cpp:45–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44struct 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;

Callers

nothing calls this directly

Calls 4

pod_from_hexFunction · 0.85
getMethod · 0.45
get_boolMethod · 0.45

Tested by

no test coverage detected