From d86b30d9d5967c453396b6ced76cc964160bffbc Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 14 Apr 2015 22:43:42 +0200 Subject: [PATCH] Options cleanup. --- eth/main.cpp | 37 +++++++++++++++++++++++++++--------- libethereum/EthereumHost.cpp | 5 +++-- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index 0896823d2..be12e3668 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -114,7 +114,7 @@ void help() << " -a,--address Set the coinbase (mining payout) address to addr (default: auto)." << endl << " -b,--bootstrap Connect to the default Ethereum peerserver." << endl << " -B,--block-fees Set the block fee profit in the reference unit e.g. ยข (Default: 15)." << endl - << " -c,--client-name Add a name to your client's version string (default: blank)." << endl + << " --client-name Add a name to your client's version string (default: blank)." << endl << " -C,--cpu When mining, use the CPU." << endl << " -d,--db-path Load database from path (default: ~/.ethereum " << endl << " /Etherum or Library/Application Support/Ethereum)." << endl @@ -143,21 +143,21 @@ void help() << " -J,--jit Enable EVM JIT (default: off)." << endl #endif << " -K,--kill First kill the blockchain." << endl - << " --listen-ip Listen on the given port for incoming connections (default: 30303)." << endl - << " -l,--listen Listen on the given IP for incoming connections (default: 0.0.0.0)." << endl - << " -u,--public-ip Force public ip to given (default: auto)." << endl + << " --listen Listen on the given port for incoming connections (default: 30303)." << endl + << " --listen-ip (:) Listen on the given IP for incoming connections (default: 0.0.0.0)." << endl + << " --public-ip Force public ip to given (default: auto)." << endl << " -m,--mining Enable mining, optionally for a specified number of blocks (Default: off)" << endl << " -M,--benchmark Benchmark for mining and exit; use with --cpu and --gpu." << endl << " -o,--mode Start a full node or a peer node (Default: full)." << endl << " --opencl-device When mining use OpenCL device n (default: 0)." << endl - << " -p,--port Connect to remote port (default: 30303)." << endl + << " --port Connect to remote port (default: 30303)." << endl << " -P,--priority <0 - 100> Default % priority of a transaction (default: 50)." << endl << " --phone-home When benchmarking, publish results (Default: on)" << endl << " -R,--rebuild First rebuild the blockchain from the existing database." << endl - << " -r,--remote Connect to remote host (default: none)." << endl + << " -r,--remote (:) Connect to remote host (default: none)." << endl << " -s,--secret Set the secret key for use with send command (default: auto)." << endl - << " -S,--temporary-secret Set the secret key for use with send command, for this session only." << endl - << " -u,--upnp Use upnp for NAT (default: on)." << endl + << " -S,--session-secret Set the secret key for use with send command, for this session only." << endl + << " --upnp Use upnp for NAT (default: on)." << endl << " -v,--verbosity <0 - 9> Set the log verbosity from 0 to 9 (Default: 8)." << endl << " -V,--version Show the version and exit." << endl << " -w,--check-pow Check PoW credentials for validity." << endl @@ -319,6 +319,9 @@ void doFarm(MinerType _m) // TODO: Set up JSONRPC client: to implement: // { "name": "eth_getWork", "params": [], "order": [], "returns": [, , ]}, // { "name": "eth_submitWork", "params": [, ], "order": [], "returns": true}, + + + exit(0); } int main(int argc, char** argv) @@ -402,13 +405,25 @@ int main(int argc, char** argv) if (arg == "--listen-ip" && i + 1 < argc) listenIP = argv[++i]; else if ((arg == "-l" || arg == "--listen" || arg == "--listen-port") && i + 1 < argc) + { + if (arg == "-l") + cerr << "-l is DEPRECATED. It will be removed for the Frontier. Use --listen-port instead." << endl; listenPort = (short)atoi(argv[++i]); + } else if ((arg == "-u" || arg == "--public-ip" || arg == "--public") && i + 1 < argc) + { + if (arg == "-u") + cerr << "-u is DEPRECATED. It will be removed for the Frontier. Use --public-ip instead." << endl; publicIP = argv[++i]; + } else if ((arg == "-r" || arg == "--remote") && i + 1 < argc) remoteHost = argv[++i]; else if ((arg == "-p" || arg == "--port") && i + 1 < argc) + { + if (arg == "-p") + cerr << "-p is DEPRECATED. It will be removed for the Frontier. Use --port instead (or place directly as host:port)." << endl; remotePort = (short)atoi(argv[++i]); + } else if ((arg == "-I" || arg == "--import") && i + 1 < argc) { mode = OperationMode::Import; @@ -467,7 +482,7 @@ int main(int argc, char** argv) else if ((arg == "-n" || arg == "-u" || arg == "--upnp") && i + 1 < argc) { if (arg == "-n") - cerr << "-n is DEPRECATED. It will be removed for the Frontier. Use -u instead." << endl; + cerr << "-n is DEPRECATED. It will be removed for the Frontier. Use --upnp instead." << endl; string m = argv[++i]; if (isTrue(m)) upnp = true; @@ -511,7 +526,11 @@ int main(int argc, char** argv) else if (arg == "-B" || arg == "--rebuild") killChain = WithExisting::Verify; else if ((arg == "-c" || arg == "--client-name") && i + 1 < argc) + { + if (arg == "-c") + cerr << "-c is DEPRECATED. It will be removed for the Frontier. Use --client-name instead." << endl; clientName = argv[++i]; + } else if ((arg == "-a" || arg == "--address" || arg == "--coinbase-address") && i + 1 < argc) try { coinbase = h160(fromHex(argv[++i], WhenError::Throw)); diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index 6b50ddbae..4f0c49146 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -133,9 +133,10 @@ void EthereumHost::noteDoneBlocks(EthereumPeer* _who, bool _clemency) { // Done our chain-get. clog(NetNote) << "Chain download failed. Peer with blocks didn't have them all. This peer is bad and should be punished."; + clog(NetNote) << "TODO: PUNISH."; - m_banned.insert(_who->session()->id()); // We know who you are! - _who->disable("Peer sent hashes but was unable to provide the blocks."); +// m_banned.insert(_who->session()->id()); // We know who you are! +// _who->disable("Peer sent hashes but was unable to provide the blocks."); } m_man.reset(); }