hygiene: Phase 2 — DragonX-authored cleanup (13 findings)

Second phase of the code-hygiene remediation, covering the items the
DragonX team introduced or the rebrand missed. No consensus behavior
changes; validated on a local self-mining node.

Log cruft:
- chainparams: route the startup ">>>>>>>>>>" banner and the port line
  through LogPrintf/LogPrint("net") instead of fprintf(stderr).
- pow: drop the fprintf(stderr) hash-mismatch dump that duplicated the
  LogPrintf copy verbatim.
- miner: gate the RandomXDatasetManager per-alloc/per-VM address dumps and
  MemDiag /proc reads behind LogPrint("randomx"); keep a one-line
  "allocated shared dataset (N GB)" summary at default verbosity.

Named constants (single source of truth in wallet.h):
- DEFAULT_AUTOSHIELD_FEE/INTERVAL, MIN_AUTOSHIELD_INTERVAL,
  DEFAULT_AUTOSHIELD_MIN_UTXOS, AUTOSHIELD_MIN/MAX_FEE for the autoshield
  option parsing and help text (were bare 10000/25/5 literals repeated
  across init.cpp and wallet.h).
- AUTO_OP_TARGET_HEIGHT_OFFSET replaces the three copy-pasted
  `blockHeight + 5` async-op scheduling offsets.
- AUTO_OP_EXPIRY_DELTA replaces the three per-file *_EXPIRY_DELTA=15
  constants (sweep/consolidation/autoshield) with one shared value.
- Move DEFAULT_AUTOSHIELD_FEE out of the op header into wallet.h so it no
  longer collides when both headers are included.

Error surfacing:
- init: report clamped/out-of-range -autoshieldinterval/-autoshieldfee via
  InitWarning() (surfaces to GUI/log) instead of fprintf(stderr).

Rebrand / dead foreign-chain code (approved removals):
- server: drop the HUSH3 special-cases in stop() and HelpExampleCli; the
  cli example now shows "dragonx-cli" instead of "hush-cli".
- getinfo (misc): remove the stale dPoW notarization block (notarized,
  prevMoMheight, notarizedhash, notarizedtxid, notarizedtxid_height,
  HUSHnotarized_height, notarized_confirms) — DragonX is a private chain
  from genesis with no active dPoW. Also fixes the hardcoded "HUSH3" that
  made getinfo query a foreign chain's notarization.
- delete the dead Komodo notary RPCs getera/getdragonjson/
  getnotarysendmany/geterablockheights (getera returned 0;
  getnotarysendmany was marked "this is broke") and their registrations.
- remove the dead ASSETCHAINS_EQUIHASH reporting branches in getinfo and
  getmininginfo — DragonX is RandomX-only.

chainparams: document why the upstream Equihash params and the literal
Bitcoin genesis are retained under RandomX (do not "fix" them).

Deferred: the hdSeedOrigin int->string switch in z_autoshieldstatus
(no shared helper exists to reuse; low value).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-27 12:24:04 -05:00
parent 798eccc624
commit aff6101987
15 changed files with 62 additions and 207 deletions

View File

@@ -872,14 +872,6 @@ bool CheckRandomXSolution(const CBlockHeader *pblock, int32_t height)
snprintf(buf, sizeof(buf), "%02x", pblock->nSolution[i]);
solutionHex += buf;
}
fprintf(stderr, "CheckRandomXSolution(): HASH MISMATCH at height %d\n", height);
fprintf(stderr, " computed : %s\n", computedHex.c_str());
fprintf(stderr, " nSolution: %s\n", solutionHex.c_str());
fprintf(stderr, " rxKey size=%lu, input size=%lu, nNonce=%s\n",
rxKey.size(), ssInput.size(), pblock->nNonce.ToString().c_str());
fprintf(stderr, " nSolution.size()=%lu, RANDOMX_HASH_SIZE=%d\n",
pblock->nSolution.size(), RANDOMX_HASH_SIZE);
// Also log to debug.log
LogPrintf("CheckRandomXSolution(): HASH MISMATCH at height %d\n", height);
LogPrintf(" computed : %s\n", computedHex);
LogPrintf(" nSolution: %s\n", solutionHex);