walletdb: Remove unused upgraded_txs

This commit is contained in:
Ava Chow committed 2025-06-17 17:41:46 -07:00
1 parent c668033709
commit 9eb2c82e7c
1 file changed
+2 -6
+2 -6
View File
@@ -1005,7 +1005,7 @@ static DBErrors LoadAddressBookRecords(CWallet* pwallet, DatabaseBatch& batch) E
return result; return result;
} }
static DBErrors LoadTxRecords(CWallet* pwallet, DatabaseBatch& batch, std::vector<Txid>& upgraded_txs, bool& any_unordered) EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet) static DBErrors LoadTxRecords(CWallet* pwallet, DatabaseBatch& batch, bool& any_unordered) EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)
{ {
AssertLockHeld(pwallet->cs_wallet); AssertLockHeld(pwallet->cs_wallet);
DBErrors result = DBErrors::LOAD_OK; DBErrors result = DBErrors::LOAD_OK;
@@ -1128,7 +1128,6 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
{ {
DBErrors result = DBErrors::LOAD_OK; DBErrors result = DBErrors::LOAD_OK;
bool any_unordered = false; bool any_unordered = false;
std::vector<Txid> upgraded_txs;
LOCK(pwallet->cs_wallet); LOCK(pwallet->cs_wallet);
@@ -1165,7 +1164,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
result = std::max(LoadAddressBookRecords(pwallet, *m_batch), result); result = std::max(LoadAddressBookRecords(pwallet, *m_batch), result);
// Load tx records // Load tx records
result = std::max(LoadTxRecords(pwallet, *m_batch, upgraded_txs, any_unordered), result); result = std::max(LoadTxRecords(pwallet, *m_batch, any_unordered), result);
// Load SPKMs // Load SPKMs
result = std::max(LoadActiveSPKMs(pwallet, *m_batch), result); result = std::max(LoadActiveSPKMs(pwallet, *m_batch), result);
@@ -1189,9 +1188,6 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
if (result != DBErrors::LOAD_OK) if (result != DBErrors::LOAD_OK)
return result; return result;
for (const Txid& hash : upgraded_txs)
WriteTx(pwallet->mapWallet.at(hash));
if (!has_last_client || last_client != CLIENT_VERSION) // Update if (!has_last_client || last_client != CLIENT_VERSION) // Update
m_batch->Write(DBKeys::VERSION, CLIENT_VERSION); m_batch->Write(DBKeys::VERSION, CLIENT_VERSION);