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
co-authored by Claude Opus 4.8
parent 798eccc624
commit aff6101987
15 changed files with 62 additions and 207 deletions
+16 -3
View File
@@ -100,6 +100,19 @@ static const unsigned int DEFAULT_TX_RETENTION_LASTTX = 200;
//Amount of transactions to delete per run while syncing
static const int MAX_DELETE_TX_SIZE = 50000;
// Shared defaults for the automated wallet operations (sweep / consolidation /
// auto-shield-coinbase). Fees are in puposhis (zats); intervals and offsets are
// in blocks. Defined here so the CWallet scheduler fields below, init.cpp's
// option parsing/help text, and the async ops reference one source of truth.
static const CAmount DEFAULT_AUTOSHIELD_FEE = 10000;
static const int DEFAULT_AUTOSHIELD_INTERVAL = 25;
static const int MIN_AUTOSHIELD_INTERVAL = 5;
static const int DEFAULT_AUTOSHIELD_MIN_UTXOS = 1;
static const CAmount AUTOSHIELD_MIN_FEE = 1000; // comfortably above minRelayTxFee for a small tx
static const CAmount AUTOSHIELD_MAX_FEE = 10000000; // 0.1 DRGX; no sane autoshield fee exceeds this
static const int AUTO_OP_TARGET_HEIGHT_OFFSET = 5; // blocks of lookahead when scheduling an async op
static const int AUTO_OP_EXPIRY_DELTA = 15; // NU-straddle expiry window, shared by all three ops
extern const char * DEFAULT_WALLET_DAT;
class CBlockIndex;
@@ -847,11 +860,11 @@ public:
std::string consolidationAddress = "";
int nextAutoShield = 0;
int autoShieldInterval = 25;
CAmount autoShieldFee = 10000;
int autoShieldInterval = DEFAULT_AUTOSHIELD_INTERVAL;
CAmount autoShieldFee = DEFAULT_AUTOSHIELD_FEE;
// Minimum matured coinbase UTXOs before a round fires, to avoid per-interval
// fee churn on a single freshly-matured reward.
int autoShieldMinUtxos = 1;
int autoShieldMinUtxos = DEFAULT_AUTOSHIELD_MIN_UTXOS;
// Configured destination z-addr override; also used to cache the resolved
// wallet-owned destination so we keep reusing one address.
std::string autoShieldAddress = "";