From 092a608fd92ae79bf8f86cf0e20fa6fe71e2c2e2 Mon Sep 17 00:00:00 2001 From: DanS Date: Tue, 25 Aug 2026 18:36:03 -0500 Subject: [PATCH] chainparams: do not let other smart chains inherit DragonX's seeds A smart chain builds its params by copying a base network and overriding pieces, but nothing ever touched vSeeds/vFixedSeeds. That is how DRAGONX ran on Hush's seeds -- seed1.hush.is and friends, long since gone from DNS -- for as long as it did, and it means any other assetchain started from this binary now inherits DragonX's. Seeds are per-chain by nature: an address serving one chain is useless to another, and dialling it is at best wasted effort and at worst a peer speaking a different protocol. DRAGONX keeps the seeds configured in CMainParams, which are its own; every other chain starts empty and relies on -addnode/-connect, which an assetchain operator has to configure regardless. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01FU87LdsJZiZkfq1eXubpeo --- src/chainparams.cpp | 14 ++++++++++++++ src/chainparams.h | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 12ffc5402..6396faabb 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -538,10 +538,24 @@ void *chainparams_commandline() { //} if ( SMART_CHAIN_SYMBOL[0] != 0 ) { + // A smart chain inherits vSeeds/vFixedSeeds from the base network params, + // and nothing below ever touched them. That is how DRAGONX came to run on + // Hush's seeds -- seed1.hush.is and friends, long since removed from DNS -- + // for as long as it did. Seeds are per-chain by nature: an address that + // serves one chain is useless to another, and dialling it is at best wasted + // effort and at worst a peer that speaks a different protocol. + // + // DRAGONX keeps the seeds configured in CMainParams (which are its own). + // Every other chain starts empty and relies on -addnode/-connect, which is + // what an assetchain operator has to configure anyway. if (strcmp(SMART_CHAIN_SYMBOL,"HUSH3") == 0) { ASSETCHAINS_P2PPORT = 18030; } + if (strncmp(SMART_CHAIN_SYMBOL, "DRAGONX", 7) != 0) { + pCurrentParams->ClearSeeds(); + } + if ( ASSETCHAINS_BLOCKTIME != 60 ) { pCurrentParams->consensus.nMaxFutureBlockTime = 7 * ASSETCHAINS_BLOCKTIME; // 7 blocks diff --git a/src/chainparams.h b/src/chainparams.h index 962f8ece9..904c44c22 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -117,6 +117,10 @@ public: void SetNValue(uint64_t n) { nEquihashN = n; } void SetKValue(uint64_t k) { nEquihashK = k; } void SetMiningRequiresPeers(bool flag) { fMiningRequiresPeers = flag; } + //! Drop any inherited peer seeds. An assetchain gets its params by copying a + //! base network and overriding pieces; without this it silently keeps the base + //! chain's DNS and fixed seeds, which are wrong for it by definition. + void ClearSeeds() { vSeeds.clear(); vFixedSeeds.clear(); } CMessageHeader::MessageStartChars pchMessageStart; Consensus::Params consensus;