From d50ffd42b12a40fce542ebf08937742fbc48eeca Mon Sep 17 00:00:00 2001 From: Jianping Wu Date: Thu, 21 Mar 2019 18:02:56 -0700 Subject: [PATCH] Returned correct error message when downloading blocks. --- src/rpc/mining.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index d134c7bdd..c06db4446 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -438,14 +438,12 @@ UniValue getblocktemplate(const JSONRPCRequest& request) LOCK(cs_main); std::string strMode = "template"; -#if 0 - // TODO: IMPORTANT!!!! uncomment the following!!! if (g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0) - throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Kevacoin is not connected!"); + throw CN_JSONRPCError(CORE_RPC_ERROR_CODE_CORE_BUSY, "Kevacoin is not connected!"); if (IsInitialBlockDownload()) - throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Kevacoin is downloading blocks..."); -#endif + throw CN_JSONRPCError(CORE_RPC_ERROR_CODE_CORE_BUSY, "Kevacoin is downloading blocks..."); + static unsigned int nTransactionsUpdatedLast; bool fSupportsSegwit = true;