wallet: Initialize m_last_block_processed to nullptr #12785

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:m_last_block_processed-setnull changing 1 files +15 −34
  1. practicalswift commented at 8:53 am on March 26, 2018: contributor

    Initialize m_last_block_processed to nullptr.

    m_last_block_processed was introduced in 5ee31726360cbe343f5a1a50a5e440db736da5b7.

  2. fanquake added the label Wallet on Mar 26, 2018
  3. jonasschnelli commented at 11:48 am on March 26, 2018: contributor
    utACK e999dd4a44d1e43fa11657dfe19fbdd89b1d2b91
  4. MarcoFalke commented at 12:19 pm on March 26, 2018: member
  5. MarcoFalke commented at 12:21 pm on March 26, 2018: member
    (Imo, you might as well remove the SetNull)
  6. practicalswift commented at 12:53 pm on March 26, 2018: contributor
    @MarcoFalke I see! What is the preferred form of pinging - it is via comment or commit message? :-)
  7. MarcoFalke commented at 1:09 pm on March 26, 2018: member
    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.
  8. laanwj commented at 10:01 am on March 28, 2018: member

    (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.

  9. practicalswift force-pushed on Apr 5, 2018
  10. practicalswift force-pushed on Apr 5, 2018
  11. practicalswift commented at 8:01 am on April 5, 2018: contributor
    Updated. Please re-review :-)
  12. in src/wallet/wallet.h:789 in 62161f4c68 outdated
    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)
    


    MarcoFalke commented at 1:11 pm on April 5, 2018:
    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
  13. practicalswift force-pushed on Apr 5, 2018
  14. practicalswift commented at 1:45 pm on April 5, 2018: contributor
    @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 :-)
  15. wallet: Initialize m_last_block_processed to nullptr. Initialize fields where defined. f63bc5e063
  16. practicalswift force-pushed on Apr 5, 2018
  17. practicalswift renamed this:
    wallet: Set m_last_block_processed to nullptr in CWallet::SetNull()
    wallet: Initialize m_last_block_processed to nullptr
    on Apr 5, 2018
  18. MarcoFalke commented at 2:34 pm on April 5, 2018: member

    utACK f63bc5e06310ea25051e2bf89c231f6096dda169

    Re developer notes: Might want to remove that statement, since it seems to conflict the latter one?

  19. laanwj commented at 2:36 pm on April 7, 2018: member
    Thank you, looks good like this. utACK f63bc5e06310ea25051e2bf89c231f6096dda169
  20. laanwj merged this on Apr 7, 2018
  21. laanwj closed this on Apr 7, 2018

  22. laanwj referenced this in commit 215158a633 on Apr 7, 2018
  23. laanwj referenced this in commit b15485ecca on Apr 7, 2018
  24. PastaPastaPasta referenced this in commit 68246d3766 on Jun 10, 2020
  25. PastaPastaPasta referenced this in commit eb20763767 on Jun 10, 2020
  26. PastaPastaPasta referenced this in commit 394e044001 on Jun 10, 2020
  27. PastaPastaPasta referenced this in commit 79f1d347bd on Jun 11, 2020
  28. PastaPastaPasta referenced this in commit bed2e9139b on Jun 11, 2020
  29. PastaPastaPasta referenced this in commit 74b56549c2 on Jun 11, 2020
  30. PastaPastaPasta referenced this in commit 1b40883df2 on Jun 12, 2020
  31. PastaPastaPasta referenced this in commit 9c357d0dad on Jul 17, 2020
  32. PastaPastaPasta referenced this in commit e88e7682a7 on Jul 17, 2020
  33. PastaPastaPasta referenced this in commit 1f173521f1 on Jul 19, 2020
  34. PastaPastaPasta referenced this in commit 5d007d8b3f on Jul 21, 2020
  35. practicalswift deleted the branch on Apr 10, 2021
  36. gades referenced this in commit 50cfaa080f on Mar 8, 2022
  37. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me