refactor: remove ::vpwallets and related global variables

Move global wallet variables to WalletContext struct
This commit is contained in:
Russell Yanofsky
2020-05-28 13:06:43 -04:00
parent fdd80b0a53
commit 62a09a3077
13 changed files with 167 additions and 127 deletions

View File

@@ -1004,14 +1004,14 @@ DBErrors WalletBatch::ZapSelectTx(std::vector<uint256>& vTxHashIn, std::vector<u
return DBErrors::LOAD_OK;
}
void MaybeCompactWalletDB()
void MaybeCompactWalletDB(WalletContext& context)
{
static std::atomic<bool> fOneThread(false);
if (fOneThread.exchange(true)) {
return;
}
for (const std::shared_ptr<CWallet>& pwallet : GetWallets()) {
for (const std::shared_ptr<CWallet>& pwallet : GetWallets(context)) {
WalletDatabase& dbh = pwallet->GetDatabase();
unsigned int nUpdateCounter = dbh.nUpdateCounter;