Skip to content

Commit 80da4be

Browse files
committed
Merge bitcoin#25896: wallet: Log when Wallet::SetMinVersion sets a different minversion
835bd27 Wallet::SetMinVersion - Log the new minversion (Ali Sherief) Pull request description: This change prints a single additional line in the debug.log when bitcoin-cli loads a wallet using `loadwallet` (*not* `createwallet`). When Bitcoin Core creates a wallet, it's `minversion` is set to `FEATURE_BASE`, which is 10500. However, once the wallet is unloaded using `unloadwallet` or through program termination, and subsequently loaded again, `loadwallet` updates the `minversion` in the wallet.dat file to `FEATURE_LATEST`, currently 169900. The current logging format prints the very old wallet version during `createwallet`, and then the actual version in calls to `loadwallet`. This has confused at least one person ([reference](https://bitcointalk.org/index.php?topic=5410650.0) - I was the one who asked there if there were plans to change that behavior, and was subsequently redirected here by achow), so it will be very helpful to users to explicitly specify in the logs what the walletdb is doing. ACKs for top commit: achow101: ACK 835bd27 Tree-SHA512: 967c8c617e06a84915ddb147378ec3c8b0343e45f43145ec78df9cbc0201867f49c8e11cd068c403eb5ec06e07d38c3c0d3864dad8edc5efbb134a3fb30be41f
2 parents eed2bd3 + 835bd27 commit 80da4be

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/wallet/wallet.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ void CWallet::SetMinVersion(enum WalletFeature nVersion, WalletBatch* batch_in)
542542
LOCK(cs_wallet);
543543
if (nWalletVersion >= nVersion)
544544
return;
545+
WalletLogPrintf("Setting minversion to %d\n", nVersion);
545546
nWalletVersion = nVersion;
546547

547548
{

0 commit comments

Comments
 (0)