Initialize m_last_block_processed to nullptr.
m_last_block_processed was introduced in 5ee31726360cbe343f5a1a50a5e440db736da5b7.
Initialize m_last_block_processed to nullptr.
m_last_block_processed was introduced in 5ee31726360cbe343f5a1a50a5e440db736da5b7.
utACK e999dd4a44d1e43fa11657dfe19fbdd89b1d2b91
(Imo, you might as well remove the SetNull)
@MarcoFalke I see! What is the preferred form of pinging - it is via comment or commit message? :-)
Usually I don't ping, but when I do, I use the second or n-th comment, since they don't end up in the commit body of the merge commit.
(Imo, you might as well remove the SetNull)
I checked and SetNull is never used outside the constructor. Agree to get rid of it, and initialize CWallet's fields in the proper way. If code needs a clean-slate wallet it can simply create a new object.
Updated. Please re-review :-)
781 | @@ -782,9 +782,12 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface 782 | unsigned int nMasterKeyMaxID; 783 | 784 | /** Construct wallet with specified name and database implementation. */ 785 | - CWallet(std::string name, std::unique_ptr<CWalletDBWrapper> dbw) : m_name(std::move(name)), dbw(std::move(dbw)) 786 | + CWallet(std::string name, std::unique_ptr<CWalletDBWrapper> dbw) : fAbortRescan(false), fScanningWallet(false), 787 | + pwalletdbEncryption(nullptr), nWalletVersion(FEATURE_BASE), nWalletMaxVersion(FEATURE_BASE), nNextResend(0), 788 | + nLastResend(0), fBroadcastTransactions(false), m_max_keypool_index(0), nTimeFirstKey(0), 789 | + m_name(std::move(name)), dbw(std::move(dbw)), m_last_block_processed(nullptr), nMasterKeyMaxID(0), 790 | + nOrderPosNext(0), nAccountingEntryNumber(0), nRelockTime(0)
Shoulnd't that be initialized where it was defined according to the developer notes? https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#c-data-structures
@MarcoFalke Oh, I misread and thought you referred to "Make sure that constructors initialize all fields" instead of the correct "Initialize all non-static class members where they are defined" in your first developer notes comment. Now fixed :-)
utACK f63bc5e06310ea25051e2bf89c231f6096dda169
Re developer notes: Might want to remove that statement, since it seems to conflict the latter one?
Thank you, looks good like this. utACK f63bc5e06310ea25051e2bf89c231f6096dda169