Skip to content

Commit fe12794

Browse files
committed
[Wallet] Remove un-necessary CheckTransaction call when loading wallet.
Large wallets suffer from long loading times as it is, this call to `CheckTransaction()` just adds to that loading time. Github-Pull: #1222 Rebased-From: 3de6c63
1 parent b8f2b1a commit fe12794

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/wallet/walletdb.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,7 @@ bool ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, CW
485485
ssKey >> hash;
486486
CWalletTx wtx;
487487
ssValue >> wtx;
488-
CValidationState state;
489-
// fZerocoinActive false because there is no reason to go through the zerocoin checks for our own wallet
490-
// fColdStakingActive true to unserialize old P2CS outputs.
491-
if (!(CheckTransaction(wtx, false, false, state, false, true) && (wtx.GetHash() == hash) && state.IsValid()))
488+
if (wtx.GetHash() != hash)
492489
return false;
493490

494491
// Undo serialize changes in 31600
@@ -733,8 +730,8 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet)
733730
bool fNoncriticalErrors = false;
734731
DBErrors result = DB_LOAD_OK;
735732

733+
LOCK(pwallet->cs_wallet);
736734
try {
737-
LOCK(pwallet->cs_wallet);
738735
int nMinVersion = 0;
739736
if (Read((std::string) "minversion", nMinVersion)) {
740737
if (nMinVersion > CLIENT_VERSION)

0 commit comments

Comments
 (0)