bitcoin/src/wallet
Wladimir J. van der Laan 735d6b57e7
Merge #16227: Refactor CWallet's inheritance chain
93ce4a0b6f Move WatchOnly stuff from SigningProvider to CWallet (Andrew Chow)
8f5b81e6ed Remove CCryptoKeyStore and move all of it's functionality into CWallet (Andrew Chow)
37a79a4fcc Move various SigningProviders to signingprovider.{cpp,h} (Andrew Chow)
16f8096e91 Move KeyOriginInfo to its own header file (Andrew Chow)
d9becff4e1 scripted-diff: rename CBasicKeyStore to FillableSigningProvider (Andrew Chow)
a913e3f2fb Move HaveKey static function from keystore to rpcwallet where it is used (Andrew Chow)
c7797ec655 Remove CKeyStore and squash into CBasicKeyStore (Andrew Chow)
1b699a5083 Add HaveKey and HaveCScript to SigningProvider (Andrew Chow)

Pull request description:

  This PR compresses the `CWallet` chain of inheritance from 5 classes to 3 classes. `CBasicKeyStore` is renamed to `FillableSigningProvider` and some parts of it (the watchonly parts) are moved into `CWallet`. `CKeyStore` and `CCrypoKeyStore` are completely removed. `CKeyStore`'s `Have*` functions are moved into `SigningProvider` and the `Add*` moved into `FillableSigningProvider`, thus allowing it to go away entirely. `CCryptoKeyStore`'s functionality is moved into `CWallet`. The new inheritance chain is:

  ```
  SigningProvider -> FillableSigningProvider -> CWallet
  ```

  `SigningProvider` now is the class the provides keys and scripts and indicates whether keys and scripts are present. `FillableSigningProvider` allows keys and scripts to be added to the signing provider via `Add*` functions. `CWallet` handles all of the watchonly stuff (`AddWatchOnly`, `HaveWatchOnly`, `RemoveWatchOnly` which were previously in `CKeyStore`) and key encryption (previously in `CCryptoKeyStore`).

  Implements the 2nd [prerequisite](https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Wallet-Class-Structure-Changes#cwallet-subclass-stack) from the wallet restructure.

ACKs for top commit:
  Sjors:
    re-ACK 93ce4a0; it keeps `EncryptSecret`, `DecryptSecret` and `DecryptKey` in `wallet/crypter.cpp`, but makes them not static. It improves alphabetical includes, reorders some function definitions, fixes commit message, brings back lost code comment.
  instagibbs:
    utACK 93ce4a0b6f

Tree-SHA512: 393dfd0623ad2dac38395eb89b862424318d6072f0b7083c92a0d207fd032c48b284f5f2cb13bc492f34557de350c5fee925da02e47daf011c5c6930a721b6d3
2019-07-11 22:42:39 +02:00
..
test Merge #16227: Refactor CWallet's inheritance chain 2019-07-11 22:42:39 +02:00
coincontrol.cpp wallet: avoid reuse flags 2019-05-29 18:40:31 +09:00
coincontrol.h wallet: avoid reuse flags 2019-05-29 18:40:31 +09: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 Remove CCryptoKeyStore and move all of it's functionality into CWallet 2019-07-09 16:20:18 -04:00
crypter.h Remove CCryptoKeyStore and move all of it's functionality into CWallet 2019-07-09 16:20:18 -04:00
db.cpp Make reasoning about dependencies easier by not including unused dependencies 2019-06-02 17:15:23 +02:00
db.h scripted-diff: Bump copyright headers in wallet 2019-05-06 14:05:52 -04:00
feebumper.cpp Replace CReserveKey with ReserveDestinatoin 2019-07-09 16:43:10 -04:00
feebumper.h scripted-diff: Bump copyright headers in wallet 2019-05-06 14:05:52 -04:00
fees.cpp [wallet] abort when attempting to fund a transaction above maxtxfee 2019-06-28 22:44:38 -04:00
fees.h Remove uses of fee globals in wallet code 2019-02-22 15:43:02 -04:00
init.cpp [build]: use #if HAVE_SYSTEM instead of defined(HAVE_SYSTEM) 2019-07-05 18:32:05 +02:00
ismine.cpp Move various SigningProviders to signingprovider.{cpp,h} 2019-07-09 16:20:18 -04:00
ismine.h Change ismine to take a CWallet instead of CKeyStore 2019-06-19 18:06:30 -04:00
load.cpp scripted-diff: Bump copyright headers in wallet 2019-05-06 14:05:52 -04:00
load.h scripted-diff: Bump copyright headers in wallet 2019-05-06 14:05:52 -04:00
psbtwallet.cpp Merge #15427: Add support for descriptors to utxoupdatepsbt 2019-07-02 16:53:22 +02:00
psbtwallet.h Remove unused TransactionError constants 2019-02-14 10:32:02 -05:00
rpcdump.cpp rpc: switch to using RPCHelpMan.Check() 2019-07-08 09:53:52 +09:00
rpcwallet.cpp Merge #16227: Refactor CWallet's inheritance chain 2019-07-11 22:42:39 +02:00
rpcwallet.h Merge #15870: wallet: Only fail rescan when blocks have actually been pruned 2019-05-16 11:18:27 -04:00
wallet.cpp Merge #16227: Refactor CWallet's inheritance chain 2019-07-11 22:42:39 +02:00
wallet.h Merge #16227: Refactor CWallet's inheritance chain 2019-07-11 22:42:39 +02:00
walletdb.cpp scripted-diff: Bump copyright headers in wallet 2019-05-06 14:05:52 -04:00
walletdb.h Have WalletBatch automatically flush every 1000 updates 2019-05-18 12:58:50 -04:00
wallettool.cpp scripted-diff: Replace fprintf with tfm::format 2019-06-13 10:32:52 -04:00
wallettool.h Move ismine to wallet module 2019-06-19 18:06:30 -04:00
walletutil.cpp Merge #15870: wallet: Only fail rescan when blocks have actually been pruned 2019-05-16 11:18:27 -04:00
walletutil.h wallet: Add WalletLocation utility class 2018-10-25 11:53:17 +01:00