Skip to content

Commit

Permalink
Merge bitcoin#9576: [wallet] Remove redundant initialization
Browse files Browse the repository at this point in the history
343ba8f [wallet] Remove redundant initialization (practicalswift)

Tree-SHA512: 54b94d7703b1735cb1ae0bd7eba61ca9d2f18e20b70e46c94aa3b0653495dce4fdea00cf953ec08215b96b5792eabb8b38c3f9b3cd36e52b82fcb2f1fd8a3540
  • Loading branch information
laanwj authored and PastaPastaPasta committed Feb 1, 2019
1 parent 8944b5a commit 4615da9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4976,17 +4976,13 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile)

RegisterValidationInterface(walletInstance);

CBlockIndex *pindexRescan = chainActive.Tip();
if (GetBoolArg("-rescan", false))
pindexRescan = chainActive.Genesis();
else
CBlockIndex *pindexRescan = chainActive.Genesis();
if (!GetBoolArg("-rescan", false))
{
CWalletDB walletdb(walletFile);
CBlockLocator locator;
if (walletdb.ReadBestBlock(locator))
pindexRescan = FindForkInGlobalIndex(chainActive, locator);
else
pindexRescan = chainActive.Genesis();
}
if (chainActive.Tip() && chainActive.Tip() != pindexRescan)
{
Expand Down

0 comments on commit 4615da9

Please sign in to comment.