Skip to content

Commit ae7e4cb

Browse files
committed
partial bitcoin#19937: signet mining utility
includes: - 95d5d5e needed for backports affecting mining_prioritisetransaction.py so we don't need to manually reconnect (or keep around) nodes.
1 parent 1770877 commit ae7e4cb

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/rpc/mining.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff 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))

0 commit comments

Comments
 (0)