Merge #9576: [wallet] Remove redundant initialization
343ba8f
[wallet] Remove redundant initialization (practicalswift)
Tree-SHA512: 54b94d7703b1735cb1ae0bd7eba61ca9d2f18e20b70e46c94aa3b0653495dce4fdea00cf953ec08215b96b5792eabb8b38c3f9b3cd36e52b82fcb2f1fd8a3540
This commit is contained in:
commit
56ab672b59
1 changed files with 2 additions and 6 deletions
|
@ -3686,17 +3686,13 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile)
|
||||||
|
|
||||||
RegisterValidationInterface(walletInstance);
|
RegisterValidationInterface(walletInstance);
|
||||||
|
|
||||||
CBlockIndex *pindexRescan = chainActive.Tip();
|
CBlockIndex *pindexRescan = chainActive.Genesis();
|
||||||
if (GetBoolArg("-rescan", false))
|
if (!GetBoolArg("-rescan", false))
|
||||||
pindexRescan = chainActive.Genesis();
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
CWalletDB walletdb(walletFile);
|
CWalletDB walletdb(walletFile);
|
||||||
CBlockLocator locator;
|
CBlockLocator locator;
|
||||||
if (walletdb.ReadBestBlock(locator))
|
if (walletdb.ReadBestBlock(locator))
|
||||||
pindexRescan = FindForkInGlobalIndex(chainActive, locator);
|
pindexRescan = FindForkInGlobalIndex(chainActive, locator);
|
||||||
else
|
|
||||||
pindexRescan = chainActive.Genesis();
|
|
||||||
}
|
}
|
||||||
if (chainActive.Tip() && chainActive.Tip() != pindexRescan)
|
if (chainActive.Tip() && chainActive.Tip() != pindexRescan)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue