Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 4,686 Lines • ▼ Show 20 Lines | CWallet::CreateWalletFromFile(const CChainParams &chainParams, | ||||
walletInstance->m_default_change_type = DEFAULT_CHANGE_TYPE; | walletInstance->m_default_change_type = DEFAULT_CHANGE_TYPE; | ||||
walletInstance->WalletLogPrintf("Wallet completed loading in %15dms\n", | walletInstance->WalletLogPrintf("Wallet completed loading in %15dms\n", | ||||
GetTimeMillis() - nStart); | GetTimeMillis() - nStart); | ||||
// Try to top up keypool. No-op if the wallet is locked. | // Try to top up keypool. No-op if the wallet is locked. | ||||
walletInstance->TopUpKeyPool(); | walletInstance->TopUpKeyPool(); | ||||
LOCK(cs_main); | LOCK2(cs_main, walletInstance->cs_wallet); | ||||
CBlockIndex *pindexRescan = chainActive.Genesis(); | CBlockIndex *pindexRescan = chainActive.Genesis(); | ||||
if (!gArgs.GetBoolArg("-rescan", false)) { | if (!gArgs.GetBoolArg("-rescan", false)) { | ||||
WalletBatch batch(*walletInstance->database); | WalletBatch batch(*walletInstance->database); | ||||
CBlockLocator locator; | CBlockLocator locator; | ||||
if (batch.ReadBestBlock(locator)) { | if (batch.ReadBestBlock(locator)) { | ||||
pindexRescan = FindForkInGlobalIndex(chainActive, locator); | pindexRescan = FindForkInGlobalIndex(chainActive, locator); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | CWallet::CreateWalletFromFile(const CChainParams &chainParams, | ||||
// Register with the validation interface. It's ok to do this after rescan | // Register with the validation interface. It's ok to do this after rescan | ||||
// since we're still holding cs_main. | // since we're still holding cs_main. | ||||
RegisterValidationInterface(walletInstance.get()); | RegisterValidationInterface(walletInstance.get()); | ||||
walletInstance->SetBroadcastTransactions( | walletInstance->SetBroadcastTransactions( | ||||
gArgs.GetBoolArg("-walletbroadcast", DEFAULT_WALLETBROADCAST)); | gArgs.GetBoolArg("-walletbroadcast", DEFAULT_WALLETBROADCAST)); | ||||
LOCK(walletInstance->cs_wallet); | |||||
walletInstance->WalletLogPrintf("setKeyPool.size() = %u\n", | walletInstance->WalletLogPrintf("setKeyPool.size() = %u\n", | ||||
walletInstance->GetKeyPoolSize()); | walletInstance->GetKeyPoolSize()); | ||||
walletInstance->WalletLogPrintf("mapWallet.size() = %u\n", | walletInstance->WalletLogPrintf("mapWallet.size() = %u\n", | ||||
walletInstance->mapWallet.size()); | walletInstance->mapWallet.size()); | ||||
walletInstance->WalletLogPrintf("mapAddressBook.size() = %u\n", | walletInstance->WalletLogPrintf("mapAddressBook.size() = %u\n", | ||||
walletInstance->mapAddressBook.size()); | walletInstance->mapAddressBook.size()); | ||||
return walletInstance; | return walletInstance; | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |