CWallet class #288

pull sipa wants to merge 2 commits into bitcoin:master from sipa:walletclass changing 21 files +2360 −2150
  1. sipa commented at 9:22 PM on June 1, 2011: member

    Introduce a new class, CWallet, to manage wallets, and move all wallet-specific code there. All wallet-related globals are turned into fields of CWallet, and one single global, pwalletMain, is added instead.

    It consists of two commits: the first one adds the new source files, and moves as much there as possible without actually changing any code. The second commit adds the class definitions, and all other changes.

    Forum thread is here: http://forum.bitcoin.org/index.php?topic=9492.0

  2. sipa commented at 8:40 AM on June 15, 2011: member

    Rebased.

  3. move wallet code to separate file
    This introduces two new source files, keystore.cpp and wallet.cpp with
    corresponding headers. Code is moved from main and db, in a preparation
    for a follow-up commit which introduces the classes CWallet and CKeyStore.
    e89b9f6a2a
  4. CWallet class
    * A new class CKeyStore manages private keys, and script.cpp depends on access to CKeyStore.
    * A new class CWallet extends CKeyStore, and contains all former wallet-specific globals; CWallet depends on script.cpp, not the other way around.
    * Wallet-specific functions in CTransaction/CTxIn/CTxOut (GetDebit, GetCredit, GetChange, IsMine, IsFromMe), are moved to CWallet, taking their former 'this' argument as an explicit parameter
    * CWalletTx objects know which CWallet they belong to, for convenience, so they have their own direct (and caching) GetDebit/... functions.
    * Some code was moved from CWalletDB to CWallet, such as handling of reserve keys.
    * Main.cpp keeps a set of all 'registered' wallets, which should be informed about updates to the block chain, and does not have any notion about any 'main' wallet. Function in main.cpp that require a wallet (such as GenerateCoins), take an explicit CWallet* argument.
    * The actual CWallet instance used by the application is defined in init.cpp as "CWallet* pwalletMain". rpc.cpp and ui.cpp use this variable.
    * Functions in main.cpp and db.cpp that are not used by other modules are marked static.
    * The code for handling the 'submitorder' message is removed, as it not really compatible with the idea that a node is independent from the wallet(s) connected to it, and obsolete anyway.
    64c7ee7e6b
  5. sipa referenced this in commit a6b2115963 on Jun 19, 2011
  6. sipa merged this on Jun 19, 2011
  7. sipa closed this on Jun 19, 2011

  8. dexX7 referenced this in commit 6fdc4f4f17 on Nov 28, 2015
  9. jamoes referenced this in commit 1862a8a277 on Feb 8, 2017
  10. classesjack referenced this in commit 31726da1ab on Jan 2, 2018
  11. lateminer referenced this in commit f10ed4f450 on Oct 16, 2019
  12. attilaaf referenced this in commit f041621eec on Jan 13, 2020
  13. cryptapus referenced this in commit d309dd406f on May 3, 2021
  14. hebasto referenced this in commit b789914f17 on May 27, 2021
  15. rajarshimaitra referenced this in commit 61a0742f7b on Aug 5, 2021
  16. DrahtBot locked this on Sep 8, 2021
Contributors

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: 2026-04-19 09:16 UTC

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