Skip to content

Commit

Permalink
[Wallet] Remove un-necessary CheckTransaction call when loading wallet.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Fuzzbawls committed Jan 11, 2020
1 parent b8f2b1a commit fe12794
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/wallet/walletdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,7 @@ bool ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, CW
ssKey >> hash;
CWalletTx wtx;
ssValue >> wtx;
CValidationState state;
// fZerocoinActive false because there is no reason to go through the zerocoin checks for our own wallet
// fColdStakingActive true to unserialize old P2CS outputs.
if (!(CheckTransaction(wtx, false, false, state, false, true) && (wtx.GetHash() == hash) && state.IsValid()))
if (wtx.GetHash() != hash)
return false;

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

LOCK(pwallet->cs_wallet);
try {
LOCK(pwallet->cs_wallet);
int nMinVersion = 0;
if (Read((std::string) "minversion", nMinVersion)) {
if (nMinVersion > CLIENT_VERSION)
Expand Down

0 comments on commit fe12794

Please sign in to comment.