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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FU87LdsJZiZkfq1eXubpeo
This commit is contained in:
2026-08-25 18:36:03 -05:00
parent 3dd667b127
commit 092a608fd9
2 changed files with 18 additions and 0 deletions

View File

@@ -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

View File

@@ -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;