wallet: low-severity polish from the dev/v1.2.0 review

Follow-up nits surfaced by the multi-agent review of the dragonx..dev delta;
none are correctness/consensus bugs, all are defensive/consistency tidy-ups.
Builds clean; the diff was reviewed across concurrency, scheduler, and
tx-building lenses.

- wallet: default CWallet::fAutoShieldEnabled to false. init.cpp always
  recomputes it (ON only for CREATED/RESTORED seed provenance) before any
  ChainTip round, so this is behaviour-neutral in the normal path and stops a
  CWallet that skips that init from auto-enabling for provenance the gate would
  reject.

- wallet: clamp a loaded hdSeedOrigin to UNKNOWN when out of enum range, so a
  corrupt/hand-edited wallet.dat cannot claim a known-recoverable seed and flip
  autoshield ON.

- wallet: key the sweep and consolidation ops' NU-straddle guard, transaction
  builder height, and expiry off execution-time tipHeight instead of the stale
  enqueue-time targetHeight_ -- matching the autoshield op (65130c312) so the
  builder's consensus-branch selection agrees with the height the tx is signed
  for. (Sweep previously built at targetHeight_ but expired at the live tip.)

- wallet: on the sweep NU-straddle skip, set sweepComplete_ so the round backs
  nextSweep off one interval instead of re-dispatching a fresh sweep op every
  block through the activation window.

- init: clamp -autoshieldinterval below 5 up to the documented minimum of 5,
  rather than silently resetting it to the default 25.

- chainparams: make the ClearSeeds guard an exact "DRAGONX" match instead of a
  7-char prefix, so DRAGONX-prefixed assetchains (e.g. DRAGONX2) no longer
  inherit DragonX's seeds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UtvyqQQSqR64DNEjUEuTmb
This commit is contained in:
2026-08-26 22:10:35 -05:00
co-authored by Claude Opus 4.8
parent fad05d3ab4
commit 02b4d03fc6
6 changed files with 44 additions and 17 deletions
+6 -3
View File
@@ -810,10 +810,13 @@ public:
bool fSweepExternalEnabled = false;
bool fSweepRunning = false;
// Automatic coinbase shielding (t->z). Default ON but conditional: it is a
// silent no-op on nodes where it cannot act (no wallet, external
// Automatic coinbase shielding (t->z). The real default is computed in
// init.cpp: ON only for known-recoverable seed provenance (CREATED/RESTORED),
// conditional, and a silent no-op where it cannot act (no wallet, external
// -mineraddress, non-mining, or locked wallet). See RunAutoShieldCoinbase.
bool fAutoShieldEnabled = true;
// The member defaults false so a CWallet that skips that init path never
// auto-enables for provenance the gate would otherwise have rejected.
bool fAutoShieldEnabled = false;
bool fAutoShieldRunning = false;
std::atomic<bool> fAbortRescan{false};