File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -658,11 +658,15 @@ static RPCHelpMan getblocktemplate()
658658 if (!node.connman )
659659 throw JSONRPCError (RPC_CLIENT_P2P_DISABLED, " Error: Peer-to-peer functionality missing or disabled" );
660660
661- if (node.connman ->GetNodeCount (CConnman::CONNECTIONS_ALL) == 0 )
662- throw JSONRPCError (RPC_CLIENT_NOT_CONNECTED, PACKAGE_NAME " is not connected!" );
661+ if (!Params ().IsTestChain ()) {
662+ if (node.connman ->GetNodeCount (CConnman::CONNECTIONS_ALL) == 0 ) {
663+ throw JSONRPCError (RPC_CLIENT_NOT_CONNECTED, PACKAGE_NAME " is not connected!" );
664+ }
663665
664- if (::ChainstateActive ().IsInitialBlockDownload ())
665- throw JSONRPCError (RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is in initial sync and waiting for blocks..." );
666+ if (::ChainstateActive ().IsInitialBlockDownload ()) {
667+ throw JSONRPCError (RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is in initial sync and waiting for blocks..." );
668+ }
669+ }
666670
667671 static unsigned int nTransactionsUpdatedLast;
668672 const CTxMemPool& mempool = EnsureMemPool (request.context );
You can’t perform that action at this time.
0 commit comments