File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -727,14 +727,19 @@ static RPCHelpMan getblocktemplate()
727727 throw JSONRPCError (RPC_INVALID_PARAMETER, " Invalid mode" );
728728
729729 const CConnman& connman = EnsureConnman (node);
730- CHECK_NONFATAL (node.sporkman );
731- if (connman.GetNodeCount (ConnectionDirection::Both) == 0 )
732- throw JSONRPCError (RPC_CLIENT_NOT_CONNECTED, PACKAGE_NAME " is not connected!" );
733730
734- if (active_chainstate.IsInitialBlockDownload ())
735- throw JSONRPCError (RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is in initial sync and waiting for blocks..." );
731+ if (!Params ().IsTestChain ()) {
732+ if (connman.GetNodeCount (ConnectionDirection::Both) == 0 ) {
733+ throw JSONRPCError (RPC_CLIENT_NOT_CONNECTED, PACKAGE_NAME " is not connected!" );
734+ }
735+
736+ if (active_chainstate.IsInitialBlockDownload ()) {
737+ throw JSONRPCError (RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is in initial sync and waiting for blocks..." );
738+ }
739+ }
736740
737741 // next bock is a superblock and we need governance info to correctly construct it
742+ CHECK_NONFATAL (node.sporkman );
738743 if (AreSuperblocksEnabled (*node.sporkman )
739744 && !node.mn_sync ->IsSynced ()
740745 && CSuperblock::IsValidBlockHeight (active_chain.Height () + 1 ))
You can’t perform that action at this time.
0 commit comments