Skip to content

Commit be3406f

Browse files
Merge dashpay#6769: fix: assign nKeysLeftSinceAutoBackup a bit later
b407f87 fix: assign `nKeysLeftSinceAutoBackup` a bit later (UdjinM6) Pull request description: ## Issue being fixed or feature implemented Wallet balance benchmarks are crashing. Not 100% sure what's going on but this patch helps. ## What was done? Assign `nKeysLeftSinceAutoBackup` a bit later. ## How Has This Been Tested? `./src/bench/bench_dash -sanity-check -priority-level=high` `./src/bench/bench_dash --filter=".*WalletBalance.*"` ## Breaking Changes n/a ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: light ACK b407f87 kwvg: ACK b407f87 Tree-SHA512: 99cbb02c794b23fa6fa97ae6362f654c5371a7061b8566f66cba7c4d2e88dfb43c4860c6d50317b30e609d823d87dbb67065831f9194ae3af8231dc6fa037bbd
2 parents 9f3e4fa + b407f87 commit be3406f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/wallet/walletdb.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -871,10 +871,6 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
871871
if (!strErr.empty())
872872
pwallet->WalletLogPrintf("%s\n", strErr);
873873
}
874-
875-
// Store initial external keypool size since we mostly use external keys in mixing
876-
pwallet->nKeysLeftSinceAutoBackup = pwallet->KeypoolCountExternalKeys();
877-
pwallet->WalletLogPrintf("nKeysLeftSinceAutoBackup: %d\n", pwallet->nKeysLeftSinceAutoBackup);
878874
} catch (...) {
879875
result = DBErrors::CORRUPT;
880876
}
@@ -924,6 +920,10 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
924920
if (result != DBErrors::LOAD_OK)
925921
return result;
926922

923+
// Store initial external keypool size since we mostly use external keys in mixing
924+
pwallet->nKeysLeftSinceAutoBackup = pwallet->KeypoolCountExternalKeys();
925+
pwallet->WalletLogPrintf("nKeysLeftSinceAutoBackup: %d\n", pwallet->nKeysLeftSinceAutoBackup);
926+
927927
// Last client version to open this wallet
928928
int last_client = CLIENT_VERSION;
929929
bool has_last_client = m_batch->Read(DBKeys::VERSION, last_client);

0 commit comments

Comments
 (0)