Skip to content

Commit 18b990b

Browse files
UdjinM6claude
andcommitted
refactor: move superblock sync check inside !IsTestChain() guard
Move the superblock sync check in getblocktemplate inside the existing !IsTestChain() block, matching the pattern used by the IBD check. Previously this was gated by SPORK_9 which was off on test networks; after spork removal the check would run unconditionally, requiring full masternode sync on test networks at superblock heights. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b2cde07 commit 18b990b

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

doc/release-notes-7278.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ Updated RPCs
1313

1414
* `getblocktemplate` now always reports `superblocks_enabled` as `true`. The
1515
field is retained for backwards compatibility.
16+
17+
* `getblocktemplate` now requires a fully synced node at superblock heights.
18+
This check is skipped on test networks. Previously it was gated by
19+
`SPORK_9_SUPERBLOCKS_ENABLED` which was already always active on mainnet.

src/rpc/mining.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -727,11 +727,11 @@ static RPCHelpMan getblocktemplate()
727727
if (active_chainstate.IsInitialBlockDownload()) {
728728
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is in initial sync and waiting for blocks...");
729729
}
730-
}
731730

732-
if (!node.mn_sync->IsSynced() && CSuperblock::IsValidBlockHeight(active_chain.Height() + 1)) {
733-
// Next block is a superblock but we need governance info to correctly construct it.
734-
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is syncing with network...");
731+
if (!node.mn_sync->IsSynced() && CSuperblock::IsValidBlockHeight(active_chain.Height() + 1)) {
732+
// Next block is a superblock but we need governance info to correctly construct it.
733+
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is syncing with network...");
734+
}
735735
}
736736

737737
static unsigned int nTransactionsUpdatedLast;

0 commit comments

Comments
 (0)