diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index deefc6ecd94..e86816935d0 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -177,10 +177,12 @@ vector ParseHexO(const UniValue& o, string strKey) return ParseHexV(find_value(o, strKey), strKey); } -/** - * Note: This interface may still be subject to change. +/***** + * Get help on a particular command + * NOTE: This interface may still be subject to change. + * @param strCommand the command (will show all commands if empty) + * @returns contextual help */ - std::string CRPCTable::help(const std::string& strCommand) const { string strRet; @@ -848,12 +850,19 @@ std::string JSONRPCExecBatch(const UniValue& vReq) return ret.write() + "\n"; } +/**** + * Execute an RPC method + * @param strMethod the method + * @param params additional parameters to go along with the method + * @returns the results + */ UniValue CRPCTable::execute(const std::string &strMethod, const UniValue ¶ms) const { - // Return immediately if in warmup + // Return help text even if chain is not fully warmed up, + // otherwise return immediately { LOCK(cs_rpcWarmup); - if (fRPCInWarmup) + if (fRPCInWarmup && strMethod != "help") throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus); } diff --git a/src/util.cpp b/src/util.cpp index 15eea4e7dcb..57ce7c66f47 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -353,6 +353,12 @@ static void InterpretNegativeSetting(string name, map& mapSettin } } +/**** + * Parse command line parameters, + * place anything that begins with "-" in mapArgs and mapMultiArgs globals + * @param argc number of arguments + * @param argv the arguments + */ void ParseParameters(int argc, const char* const argv[]) { mapArgs.clear(); @@ -387,7 +393,7 @@ void ParseParameters(int argc, const char* const argv[]) } // New 0.6 features: - BOOST_FOREACH(const PAIRTYPE(string,string)& entry, mapArgs) + for(const auto& entry : mapArgs) { // interpret -nofoo as -foo=0 (and -nofoo=0 as -foo=1) as long as -foo not set InterpretNegativeSetting(entry.first, mapArgs); @@ -970,6 +976,9 @@ void RenameThread(const char* name) #endif } +/*** + * Set up the correct locale (aids in filesystem paths) + */ void SetupEnvironment() { // On most POSIX systems (e.g. Linux, but not BSD) the environment's locale @@ -989,6 +998,10 @@ void SetupEnvironment() boost::filesystem::path::imbue(loc); } +/***** + * Initialize networking/socket libraries (i.e. Windows winsock) + * @returns false on failure + */ bool SetupNetworking() { #ifdef _WIN32