Merge #12785: wallet: Initialize m_last_block_processed to nullptr

f63bc5e wallet: Initialize m_last_block_processed to nullptr. Initialize fields where defined. (practicalswift)

Pull request description:

  Initialize `m_last_block_processed` to `nullptr`.

  `m_last_block_processed` was introduced in 5ee3172636.

Tree-SHA512: 6e4a807e5b02115cbd80460761056f2eb22043203212d88dd0cd44c28dc0abce30ab29b078ca2c612232e76af4886f4fdbf2b0ff75e2df19b4d1a801b236cc13
This commit is contained in:
Wladimir J. van der Laan 2018-04-07 16:39:56 +02:00 committed by Pasta
parent c1c84d6987
commit 1b40883df2
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -701,8 +701,8 @@ class WalletRescanReserver; //forward declarations for ScanForWalletTransactions
class CWallet final : public CCryptoKeyStore, public CValidationInterface
{
private:
std::atomic<bool> fAbortRescan;
std::atomic<bool> fScanningWallet; //controlled by WalletRescanReserver
std::atomic<bool> fAbortRescan{false};
std::atomic<bool> fScanningWallet{false}; // controlled by WalletRescanReserver
std::mutex mutexScanning;
friend class WalletRescanReserver;
@ -714,17 +714,17 @@ private:
*/
bool SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAmount& nTargetValue, std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet, const CCoinControl *coinControl = nullptr) const;
WalletBatch *encrypted_batch;
WalletBatch *encrypted_batch = nullptr;
//! the current wallet version: clients below this version are not able to load the wallet
int nWalletVersion;
int nWalletVersion = FEATURE_BASE;
//! the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded
int nWalletMaxVersion;
int nWalletMaxVersion = FEATURE_BASE;
int64_t nNextResend;
int64_t nLastResend;
bool fBroadcastTransactions;
int64_t nNextResend = 0;
int64_t nLastResend = 0;
bool fBroadcastTransactions = false;
mutable bool fAnonymizableTallyCached;
mutable std::vector<CompactTallyItem> vecAnonymizableTallyCached;
@ -758,10 +758,10 @@ private:
std::set<int64_t> setInternalKeyPool;
std::set<int64_t> setExternalKeyPool;
int64_t m_max_keypool_index;
int64_t m_max_keypool_index = 0;
std::map<CKeyID, int64_t> m_pool_key_to_index;
int64_t nTimeFirstKey;
int64_t nTimeFirstKey = 0;
/**
* Private version of AddWatchOnly method which does not accept a
@ -801,7 +801,7 @@ private:
*
* Protected by cs_main (see BlockUntilSyncedToCurrentChain)
*/
const CBlockIndex* m_last_block_processed;
const CBlockIndex* m_last_block_processed = nullptr;
public:
/*
@ -832,12 +832,11 @@ public:
typedef std::map<unsigned int, CMasterKey> MasterKeyMap;
MasterKeyMap mapMasterKeys;
unsigned int nMasterKeyMaxID;
unsigned int nMasterKeyMaxID = 0;
/** Construct wallet with specified name and database implementation. */
CWallet(std::string name, std::unique_ptr<WalletDatabase> database) : m_name(std::move(name)), database(std::move(database))
{
SetNull();
}
~CWallet()
@ -846,28 +845,6 @@ public:
encrypted_batch = nullptr;
}
void SetNull()
{
nWalletVersion = FEATURE_BASE;
nWalletMaxVersion = FEATURE_BASE;
nMasterKeyMaxID = 0;
encrypted_batch = nullptr;
nOrderPosNext = 0;
nAccountingEntryNumber = 0;
nNextResend = 0;
nLastResend = 0;
m_max_keypool_index = 0;
nTimeFirstKey = 0;
fBroadcastTransactions = false;
nRelockTime = 0;
fAbortRescan = false;
fScanningWallet = false;
fAnonymizableTallyCached = false;
fAnonymizableTallyCachedNonDenom = false;
vecAnonymizableTallyCached.clear();
vecAnonymizableTallyCachedNonDenom.clear();
}
std::map<uint256, CWalletTx> mapWallet;
std::list<CAccountingEntry> laccentries;
@ -875,8 +852,8 @@ public:
typedef std::multimap<int64_t, TxPair > TxItems;
TxItems wtxOrdered;
int64_t nOrderPosNext;
uint64_t nAccountingEntryNumber;
int64_t nOrderPosNext = 0;
uint64_t nAccountingEntryNumber = 0;
std::map<uint256, int> mapRequestCount;
std::map<CTxDestination, CAddressBookData> mapAddressBook;
@ -1006,7 +983,7 @@ public:
bool LoadWatchOnly(const CScript &dest);
//! Holds a timestamp at which point the wallet is scheduled (externally) to be relocked. Caller must arrange for actual relocking to occur via Lock().
int64_t nRelockTime;
int64_t nRelockTime = 0;
bool Unlock(const SecureString& strWalletPassphrase, bool fForMixingOnly = false);
bool ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase);