X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fbitcoinrpc.h;h=d0a3712ba053bd966f8da6f913f4301e34319b03;hb=cc5173a20534bd761caca6c5291cadc42a0ba5d7;hp=6c707ea87fcf72712b38b112d19d852920642fbe;hpb=27e35b80c7f1b1bbf43f1d7b719a2569e8149f9f;p=novacoin.git diff --git a/src/bitcoinrpc.h b/src/bitcoinrpc.h index 6c707ea..d0a3712 100644 --- a/src/bitcoinrpc.h +++ b/src/bitcoinrpc.h @@ -68,7 +68,8 @@ enum RPCErrorCode json_spirit::Object JSONRPCError(int code, const std::string& message); -void ThreadRPCServer(void* parg); +void StartRPCServer(); +void StopRPCServer(); int CommandLineRPC(int argc, char *argv[]); /** Convert parameter values for RPC call from strings to command-specific JSON objects. */ @@ -108,8 +109,8 @@ private: std::map mapCommands; public: CRPCTable(); - const CRPCCommand* operator[](std::string name) const; - std::string help(std::string name) const; + const CRPCCommand* operator[](const std::string& name) const; + std::string help(const std::string& name) const; /** * Execute a method. @@ -119,6 +120,12 @@ public: * @throws an exception (json_spirit::Value) when an error happens. */ json_spirit::Value execute(const std::string &method, const json_spirit::Array ¶ms) const; + + /** + * Returns a list of registered commands + * @returns List of registered commands. + */ + std::vector listCommands() const; }; extern const CRPCTable tableRPC; @@ -139,10 +146,10 @@ extern void EnsureWalletIsUnlocked(); // Utilities: convert hex-encoded Values // (throws error if not hex). // -extern uint256 ParseHashV(const json_spirit::Value& v, std::string strName); -extern uint256 ParseHashO(const json_spirit::Object& o, std::string strKey); -extern std::vector ParseHexV(const json_spirit::Value& v, std::string strName); -extern std::vector ParseHexO(const json_spirit::Object& o, std::string strKey); +extern uint256 ParseHashV(const json_spirit::Value& v, const std::string& strName); +extern uint256 ParseHashO(const json_spirit::Object& o, const std::string& strKey); +extern std::vector ParseHexV(const json_spirit::Value& v, const std::string& strName); +extern std::vector ParseHexO(const json_spirit::Object& o, const std::string& strKey); extern json_spirit::Value getconnectioncount(const json_spirit::Array& params, bool fHelp); // in rpcnet.cpp extern json_spirit::Value getpeerinfo(const json_spirit::Array& params, bool fHelp); @@ -212,12 +219,6 @@ extern json_spirit::Value adjustmalleablepubkey(const json_spirit::Array& params extern json_spirit::Value listmalleableviews(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value dumpmalleablekey(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value importmalleablekey(const json_spirit::Array& params, bool fHelp); -extern json_spirit::Value dumppem(const json_spirit::Array& params, bool fHelp); - -extern json_spirit::Value encryptdata(const json_spirit::Array& params, bool fHelp); // in rpccrypt.cpp -extern json_spirit::Value decryptdata(const json_spirit::Array& params, bool fHelp); -extern json_spirit::Value encryptmessage(const json_spirit::Array& params, bool fHelp); -extern json_spirit::Value decryptmessage(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getrawtransaction(const json_spirit::Array& params, bool fHelp); // in rcprawtransaction.cpp extern json_spirit::Value listunspent(const json_spirit::Array& params, bool fHelp);