0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-11 15:56:58 -04:00
bitcoin-core/src/wallet
MeshCollider 2607d960a0
Merge #10973: Refactor: separate wallet from node
d358466de Remove remaining wallet accesses to node globals (Russell Yanofsky)
b1b2b2389 Remove use of CCoinsViewMemPool::GetCoin in wallet code (Russell Yanofsky)
4e4d9e9f8 Remove use of CRPCTable::appendCommand in wallet code (Russell Yanofsky)
91868e628 Remove use CValidationInterface in wallet code (Russell Yanofsky)

Pull request description:

  This PR is the last in a chain of PRs (#14437, #14711, and #15288) that make the wallet code access node state through an abstract [`Chain`](https://github.com/ryanofsky/bitcoin/blob/pr/wipc-sep/src/interfaces/chain.h) class in [`src/interfaces/`](https://github.com/ryanofsky/bitcoin/tree/pr/wipc-sep/src/interfaces) instead of using global variables like `cs_main`, `chainActive`, and `g_connman`. After this PR, wallet code no longer accesses global variables declared outside the wallet directory, and no longer calls functions accessing those globals (as verified by the `hide-globals` script in #10244).

  This PR and the previous PRs have been refactoring changes that do not affect behavior. Previous PRs have consisted of lots of mechanical changes like:

  ```diff
  -    wtx.nTimeReceived = GetAdjustedTime();
  +    wtx.nTimeReceived = m_chain->getAdjustedTime();
  ```

  This PR is smaller, but less mechanical. It replaces last few bits of wallet code that access node state directly (through `CValidationInterface`, `CRPCTable`, and `CCoinsViewMemPool` interfaces) with code that uses the `Chain` interface.

  These changes allow followup PR #10102 (multiprocess gui & wallet PR) to work without any significant updates to wallet code. Additionally they:

  * Provide a single place to describe the interface between wallet and node code.
  * Can make better wallet testing possible, because the `Chain` object consists of virtual methods that can be overloaded for mocking. (This could be used to test edge cases in the rescan code, for example).

Tree-SHA512: e6291d8a3c50bdff18a9c8ad11e729beb30b5b7040d7aaf31ba678800b4a97b2dd2be76340b1e5c01fe2827d67d37ed1bb4c8380cf8ed653aadfea003e9b22e7
2019-03-21 20:58:43 +13:00
..
test Remove use of CRPCTable::appendCommand in wallet code 2019-03-05 10:20:00 -04:00
coincontrol.cpp scripted-diff: Move util files to separate directory. 2018-11-04 22:46:07 -08:00
coincontrol.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
coinselection.cpp Introduce a Shuffle for FastRandomContext and use it in wallet and coinselection 2018-12-12 14:22:12 -08:00
coinselection.h amount: Move CAmount CENT to unit test header 2018-09-17 14:34:56 -04:00
crypter.cpp [wallet] Support creating a blank wallet 2019-02-10 12:24:53 -05:00
crypter.h [tools] Add wallet inspection and modification tool 2019-01-30 16:26:52 -05:00
db.cpp wallet: Improve log output for errors during load 2019-03-14 18:49:19 -07:00
db.h wallet: Improve log output for errors during load 2019-03-14 18:49:19 -07:00
feebumper.cpp Remove remaining wallet accesses to node globals 2019-03-06 16:47:57 -05:00
feebumper.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
fees.cpp Remove remaining wallet accesses to node globals 2019-03-06 16:47:57 -05:00
fees.h Remove uses of fee globals in wallet code 2019-02-22 15:43:02 -04:00
init.cpp Remove remaining wallet accesses to node globals 2019-03-06 16:47:57 -05:00
psbtwallet.cpp Remove unused TransactionError constants 2019-02-14 10:32:02 -05:00
psbtwallet.h Remove unused TransactionError constants 2019-02-14 10:32:02 -05:00
rpcdump.cpp Remove remaining wallet accesses to node globals 2019-03-06 16:47:57 -05:00
rpcwallet.cpp Remove remaining wallet accesses to node globals 2019-03-06 16:47:57 -05:00
rpcwallet.h Remove use of CRPCTable::appendCommand in wallet code 2019-03-05 10:20:00 -04:00
wallet.cpp Merge #10973: Refactor: separate wallet from node 2019-03-21 20:58:43 +13:00
wallet.h Merge #10973: Refactor: separate wallet from node 2019-03-21 20:58:43 +13:00
walletdb.cpp wallet: Improve log output for errors during load 2019-03-14 18:49:19 -07:00
walletdb.h Store key origin info in key metadata 2019-02-14 17:58:25 -05:00
wallettool.cpp [wallet] Close bdb when flushing wallet. 2019-02-12 13:27:18 -05:00
wallettool.h [tools] Add wallet inspection and modification tool 2019-01-30 16:26:52 -05:00
walletutil.cpp wallet: Log and ignore errors in ListWalletDir and IsBerkeleyBtree 2019-03-13 20:41:42 +00:00
walletutil.h wallet: Add WalletLocation utility class 2018-10-25 11:53:17 +01:00