From 514867c5d9ef4f971c630b24fdb664a9dd59b665 Mon Sep 17 00:00:00 2001 From: Sami Date: Mon, 15 Jun 2026 16:07:23 -0700 Subject: [PATCH] wallet(HD): flush keypool on seed set so getnewaddress yields HD keys immediately --- src/wallet.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wallet.cpp b/src/wallet.cpp index ff4a197..2b7d0a8 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -2935,6 +2935,9 @@ bool CWallet::SetHDSeed(const std::string& mnemonicIn, const std::string& passph } wdb.WriteHDChain(nHDChainIndex); } + // Replace any pre-existing (random) keypool with HD-derived keys so that + // getnewaddress immediately hands out deterministic m/44'/2222'/0'/0/i keys. + NewKeyPool(); mnemonicOut = m; return true; }