From a109dcd23fd387324e63f265a237723ba1d6c4fa Mon Sep 17 00:00:00 2001 From: Nsable-sh Date: Wed, 12 Aug 2026 14:44:43 -0300 Subject: wallet: collapse restored legacy hdnext --- src/walletcmd.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/walletcmd.h') diff --git a/src/walletcmd.h b/src/walletcmd.h index 04d3fb7..007b8b5 100644 --- a/src/walletcmd.h +++ b/src/walletcmd.h @@ -7,7 +7,9 @@ #ifndef BITFLASH_WALLETCMD_H #define BITFLASH_WALLETCMD_H +#include #include +#include // Create a phrase for a wallet that does not have one, install the seed, and // show the words once. Refuses if a phrase already exists. Returns 0 on success. @@ -41,6 +43,13 @@ bool RestoreScanReachedDepth(int nSchema, unsigned int nLegacyNext, int nStopDepth); +// Given the pubkeys derived while scanning a compatibility branch, return the +// next index after the highest one that actually appears in wallet +// transactions. The scan depth can be much larger than this; hdnext must record +// use, not how far a restore looked ahead. +unsigned int WalletLastUsedPubKeyIndexNext( + const std::map >& mapPubKeysByIndex); + // Take the next address from the key pool and print it. With a recovery phrase // installed the address is derived, so the phrase can bring back whatever is // paid to it. -- cgit v1.2.3