mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge #16227: Refactor CWallet's inheritance chain
93ce4a0b6fMove WatchOnly stuff from SigningProvider to CWallet (Andrew Chow)8f5b81e6edRemove CCryptoKeyStore and move all of it's functionality into CWallet (Andrew Chow)37a79a4fccMove various SigningProviders to signingprovider.{cpp,h} (Andrew Chow)16f8096e91Move KeyOriginInfo to its own header file (Andrew Chow)d9becff4e1scripted-diff: rename CBasicKeyStore to FillableSigningProvider (Andrew Chow)a913e3f2fbMove HaveKey static function from keystore to rpcwallet where it is used (Andrew Chow)c7797ec655Remove CKeyStore and squash into CBasicKeyStore (Andrew Chow)1b699a5083Add 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: utACK93ce4a0b6fTree-SHA512: 393dfd0623ad2dac38395eb89b862424318d6072f0b7083c92a0d207fd032c48b284f5f2cb13bc492f34557de350c5fee925da02e47daf011c5c6930a721b6d3
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include <core_io.h>
|
||||
#include <index/txindex.h>
|
||||
#include <key_io.h>
|
||||
#include <keystore.h>
|
||||
#include <merkleblock.h>
|
||||
#include <node/coin.h>
|
||||
#include <node/psbt.h>
|
||||
@@ -24,6 +23,7 @@
|
||||
#include <script/script.h>
|
||||
#include <script/script_error.h>
|
||||
#include <script/sign.h>
|
||||
#include <script/signingprovider.h>
|
||||
#include <script/standard.h>
|
||||
#include <uint256.h>
|
||||
#include <util/moneystr.h>
|
||||
@@ -736,7 +736,7 @@ static UniValue signrawtransactionwithkey(const JSONRPCRequest& request)
|
||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
||||
}
|
||||
|
||||
CBasicKeyStore keystore;
|
||||
FillableSigningProvider keystore;
|
||||
const UniValue& keys = request.params[1].get_array();
|
||||
for (unsigned int idx = 0; idx < keys.size(); ++idx) {
|
||||
UniValue k = keys[idx];
|
||||
|
||||
Reference in New Issue
Block a user