diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 049df8b0c..6cfd7f5e1 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -131,7 +131,9 @@ public: consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight = Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT; // The best chain should have at least this much work. - consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000000281b32ff3198a1"); + // DRAGONX mainnet chainwork @ height ~3,100,000 (2026-07), safely below the live tip. + // (Previous value 0x281b32ff3198a1 was a stale inherited figure ABOVE the live chain.) Bump on release. + consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000026dfbdb6fa39e0"); /** * The message start string is designed to be unlikely to occur in normal data. diff --git a/src/main.cpp b/src/main.cpp index e8884b3bc..d72d730cc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2456,6 +2456,17 @@ bool IsInitialBlockDownload() //fprintf(stderr,"nullptr in IsInitialDownload\n"); return true; } + + // SECURITY: enforce the known-good minimum chain work (defined in chainparams but previously + // never checked). Keeps an eclipsed/bootstrapping node from trusting a cheap low-work fake + // chain -- a recent tip timestamp alone (below) is not sufficient. Gated to the DRAGONX symbol + // so ephemeral assetchains (fresh, low work) run from the same binary are not trapped in IBD. + if (strncmp(SMART_CHAIN_SYMBOL, "DRAGONX", 7) == 0 && + ptr->chainPower.chainWork < UintToArith256(chainParams.GetConsensus().nMinimumChainWork)) + { + return true; + } + state = ((chainActive.Height() < ptr->GetHeight() - 24*60) || ptr->GetBlockTime() < (GetTime() - nMaxTipAge)); if ( HUSH_INSYNC != 0 )