From 5960d0d8619f11a4f5c22472573ee02894794ea1 Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Thu, 13 Nov 2025 11:10:40 +0100 Subject: [PATCH] feat(rpc): allow getblocktemplate during initial block download for testnet This temporary patch enables getblocktemplate RPC calls during initial block download for testnet purposes. The change will be reverted for mainnet. --- src/rpc/mining.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 90114af..5277d63 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -491,8 +491,10 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) if (g_rpc_node->connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0) throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, PACKAGE_NAME " is not connected!"); - if (::ChainstateActive().IsInitialBlockDownload()) - throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is in initial sync and waiting for blocks..."); + // PATCH: Allow getblocktemplate even during initial block download for testnet purposes + // TODO: Remove this patch for mainnet - it's only for testnet startup + // if (::ChainstateActive().IsInitialBlockDownload()) + // throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is in initial sync and waiting for blocks..."); static unsigned int nTransactionsUpdatedLast; const CTxMemPool& mempool = EnsureMemPool();