From 5a5478669c487963e99491112abc065c59973966 Mon Sep 17 00:00:00 2001 From: mtg0001 <106211915+mtg0001@users.noreply.github.com> Date: Sat, 1 Aug 2026 21:43:45 -0300 Subject: Keep new phrase addresses recoverable (#102) -newphrase installed a seed but left the wallet's visible address as the pre-seed random key and the old random pool intact, so the next address handed out -- a mining payout included -- could be one the twelve words cannot reproduce, while the window said a recovery phrase existed. Installing a phrase now clears the stale pool records (private keys stay in wallet.dat), reserves a derived default receiving key, tolerates already-stored derived keys so repeated installs do not stall the pool, and -restorephrase reports what it recovered rather than the wallet's total transaction count. Self-test covers installing a phrase over a pre-existing random pool. --- src/main.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main.h') diff --git a/src/main.h b/src/main.h index a04a4e3..1b0be59 100644 --- a/src/main.h +++ b/src/main.h @@ -159,8 +159,9 @@ extern vector vchHDChainCode; // 32 bytes (IR) extern unsigned int nHDNext; // next child index to derive inline bool HaveHDSeed() { return vchHDMaster.size() == 32 && vchHDChainCode.size() == 32; } -// Install a seed derived from a mnemonic, replacing any existing one, and reset -// the derivation counter. Writes to wallet.dat. Returns false and leaves the +// Install a seed derived from a mnemonic, replacing any existing one. The +// default receiving key is derived immediately, so the next visible address is +// covered by the phrase. Writes to wallet.dat. Returns false and leaves the // wallet untouched if the phrase is not valid. bool SetHDSeedFromMnemonic(const string& strMnemonic, string& strErrorRet); -- cgit v1.2.3