Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
Show First 20 Lines • Show All 556 Lines • ▼ Show 20 Lines | if (!g_connman) { | ||||
"Error: Peer-to-peer functionality missing or disabled"); | "Error: Peer-to-peer functionality missing or disabled"); | ||||
} | } | ||||
if (g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0) { | if (g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0) { | ||||
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, | throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, | ||||
"Bitcoin is not connected!"); | "Bitcoin is not connected!"); | ||||
} | } | ||||
if (IsInitialBlockDownload()) { | if (::ChainstateActive().IsInitialBlockDownload()) { | ||||
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, | throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME | ||||
"Bitcoin is downloading blocks..."); | " is in initial sync and waiting for blocks..."); | ||||
} | } | ||||
static unsigned int nTransactionsUpdatedLast; | static unsigned int nTransactionsUpdatedLast; | ||||
if (!lpval.isNull()) { | if (!lpval.isNull()) { | ||||
// Wait to respond until either the best block changes, OR a minute has | // Wait to respond until either the best block changes, OR a minute has | ||||
// passed and there are more transactions | // passed and there are more transactions | ||||
uint256 hashWatchedChain; | uint256 hashWatchedChain; | ||||
▲ Show 20 Lines • Show All 322 Lines • Show Last 20 Lines |