hygiene: Phase 5 — correct stale comments + name safe magic numbers

Fifth phase of the code-hygiene remediation, done per-file (18 files) via an
18-agent Workflow with strict guardrails. No consensus or security VALUES
changed (verified: pow/hush_utils/hush_bitcoind/net.h/crypter/stratum have
zero non-comment numeric changes); built clean, self-mined, verifychain=true.

Totals: 57 stale comments corrected, 46 user-facing branding fixes, 6
behavior-preserving named constants, 4 stratum warnings, 77 items deliberately
left (consensus/security values, copyright headers).

- Stale comments -> DragonX: corrected HUSH3/HUSH/Komodo/Equihash/Arrakis
  leftovers that misdescribed the active chain (pow AWT/lwma notes, txdb
  "Equihash solution" -> RandomX, wallet CLTV/overwinter/Sapling@1 notes,
  util datadir provenance, crypter's stale mapSproutSpendingKeys invariant).
  Replaced unprofessional/editorializing comments (profane TODOs, "developers
  are elite") with neutral technical notes, preserving the real design info.
- User-facing branding: dumpwallet header "created by Hush" -> "DragonX";
  RPC help text hushd/hush-cli/hushprivkey/hushaddress/Agama -> dragonx*;
  rebranded provably-dead "HUSH3" symbol-fallback literals to DRAGONX.
- Named constants (same values, non-consensus/non-security): addrman
  peer-selection factors (kChanceFactorGrowth/kChanceScale/deprioritize),
  sietch MIN_ZOUTS, an init notarization-DB cache size.
- Left the security macros (ECC/TFM_TIMING_RESISTANT=420, comment-clarified
  only), the consensus subsidy/commission literals + 128/129 TRANSITION
  (comment only), and copyright headers untouched.
- Added a prominent WARNING that the stratum server is Equihash-era and NOT
  updated for DragonX's RandomX PoW (flagged, not rewritten).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-27 15:19:22 -05:00
co-authored by Claude Opus 4.8
parent cf15b0a399
commit 817c6b2d0e
18 changed files with 251 additions and 141 deletions
+31 -19
View File
@@ -499,27 +499,35 @@ boost::filesystem::path GetDefaultDataDir()
if ( SMART_CHAIN_SYMBOL[0] != 0 )
strcpy(symbol,SMART_CHAIN_SYMBOL);
else symbol[0] = 0;
// OLD NAMES:
// Windows < Vista: C:\Documents and Settings\Username\Application Data\Komodo
// Windows >= Vista: C:\Users\Username\AppData\Roaming\Komodo
// Mac: ~/Library/Application Support/Komodo
// Unix: ~/.komodo
// DragonX stores its data under a per-chain subdirectory named after
// SMART_CHAIN_SYMBOL (which is "DRAGONX"), so the default datadir resolves
// to (Unix) ~/.hush/DRAGONX, (Mac) ~/Library/Application Support/Hush/DRAGONX,
// or (Windows) %APPDATA%\Hush\DRAGONX.
//
// The "Hush" / "Komodo" parent-directory names below are retained from the
// Hush/Komodo lineage: the ".hush"/"Hush" path is the current location, and
// the ".komodo"/"Komodo" path is only probed as a backward-compatible
// fallback for pre-existing legacy data directories. Do not change these
// string literals -- they determine where node data is read from and written.
// NEW NAMES:
// Current (per-symbol subdirectory lives under these parents):
// Windows < Vista: C:\Documents and Settings\Username\Application Data\Hush
// Windows >= Vista: C:\Users\Username\AppData\Roaming\Hush
// Mac: ~/Library/Application Support/Hush
// Unix: ~/.hush
// ~/.hush was actually used by the original 1.x version of Hush, but we will
// only make subdirectories inside of it, so we won't be able to overwrite
// an old wallet.dat from the Ice Ages :)
// Legacy fallback (only used if such a directory already exists):
// Windows < Vista: C:\Documents and Settings\Username\Application Data\Komodo
// Windows >= Vista: C:\Users\Username\AppData\Roaming\Komodo
// Mac: ~/Library/Application Support/Komodo
// Unix: ~/.komodo
fs::path pathRet;
#ifdef _WIN32
// Windows
pathRet = GetSpecialFolderPath(CSIDL_APPDATA) / "Hush" / symbol;
// Always use .hush/HUSH3, if it exists (even if .komodo/HUSH3 exists)
// Always use Hush\<symbol> (Hush\DRAGONX) if it exists, even if the legacy
// Komodo\<symbol> directory also exists.
if(fs::is_directory(pathRet)) {
return pathRet;
} else {
@@ -528,7 +536,7 @@ boost::filesystem::path GetDefaultDataDir()
// existing legacy directory, use that for backward compat
return pathRet;
} else {
// For new clones, use Hush/ACNAME
// For new nodes, use Hush\<symbol>
pathRet = GetSpecialFolderPath(CSIDL_APPDATA) / "Hush" / symbol;
return pathRet;
}
@@ -551,7 +559,7 @@ boost::filesystem::path GetDefaultDataDir()
// create Library/Application Support/Hush if it doesn't exist
TryCreateDirectory(tmppath);
// Always use Hush/HUSH3 if it exists
// Always use Hush/<symbol> (Hush/DRAGONX) if it exists
if(fs::is_directory(tmppath / symbol)) {
return tmppath / symbol;
} else {
@@ -563,16 +571,16 @@ boost::filesystem::path GetDefaultDataDir()
// Found legacy dir, use that
return tmppath / symbol;
} else {
// For new clones, use Hush/ACNAME
// For new nodes, use Hush/<symbol>
tmppath = pathRet / "Hush" / symbol;
}
return tmppath;
}
#else
// Unix
// New directory :)
// Unix: current default datadir is ~/.hush/<symbol> (i.e. ~/.hush/DRAGONX)
fs::path tmppath = pathRet / ".hush" / symbol;
// Always use .hush/HUSH3, if it exists (even if .komodo/HUSH3 exists)
// Always use ~/.hush/<symbol> (~/.hush/DRAGONX) if it exists, even if the
// legacy ~/.komodo/<symbol> directory also exists.
if(fs::is_directory(tmppath)) {
return tmppath;
} else {
@@ -582,7 +590,7 @@ boost::filesystem::path GetDefaultDataDir()
// existing legacy directory, use that for backward compat
return tmppath;
} else {
// For new clones, use .hush/ACNAME
// For new nodes, use ~/.hush/<symbol>
tmppath = pathRet / ".hush" / symbol;
}
return tmppath;
@@ -598,13 +606,17 @@ static CCriticalSection csPathCached;
static boost::filesystem::path ZC_GetBaseParamsDir()
{
// Copied from GetDefaultDataDir and adapted for zcash params.
// Copied from GetDefaultDataDir and adapted for the zk-SNARK parameter files.
// DragonX reuses the upstream Sapling parameter directory layout, so these
// locations retain the historical "ZcashParams" / ".zcash-params" names. Do
// not change these string literals -- they determine where the proving and
// verifying keys are loaded from.
namespace fs = boost::filesystem;
// Windows < Vista: C:\Documents and Settings\Username\Application Data\ZcashParams
// Windows >= Vista: C:\Users\Username\AppData\Roaming\ZcashParams
// Mac: ~/Library/Application Support/ZcashParams
// Unix: ~/.zcash-params
// Debian packages: /usr/share/hush
// System-wide install (Debian packages): /usr/share/hush
fs::path pathRet;
#ifdef _WIN32
return GetSpecialFolderPath(CSIDL_APPDATA) / "ZcashParams";