From 06620302c713cae65ee8e4ff9302e4c88e2a1285 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Tue, 16 Jul 2019 13:34:35 -0400 Subject: Introduce SetType function to tell ScriptPubKeyMans the type and internal-ness of it --- src/wallet/scriptpubkeyman.cpp | 2 ++ src/wallet/scriptpubkeyman.h | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index ec75f06e5e..f8f5740b38 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -1497,3 +1497,5 @@ std::set LegacyScriptPubKeyMan::GetKeys() const } return set_address; } + +void LegacyScriptPubKeyMan::SetType(OutputType type, bool internal) {} diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h index 8512eadf31..0564d0cbc2 100644 --- a/src/wallet/scriptpubkeyman.h +++ b/src/wallet/scriptpubkeyman.h @@ -222,6 +222,8 @@ public: virtual uint256 GetID() const { return uint256(); } + virtual void SetType(OutputType type, bool internal) {} + /** Prepends the wallet name in logging output to ease debugging in multi-wallet use cases */ template void WalletLogPrintf(std::string fmt, Params... parameters) const { @@ -366,6 +368,8 @@ public: uint256 GetID() const override; + void SetType(OutputType type, bool internal) override; + // Map from Key ID to key metadata. std::map mapKeyMetadata GUARDED_BY(cs_KeyStore); -- cgit v1.2.3 From 6b8119af53ee2fdb4c4b5b24b4e650c0dc3bd27c Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Fri, 5 Jul 2019 18:16:48 -0400 Subject: Introduce DescriptorScriptPubKeyMan as a dummy class --- src/wallet/scriptpubkeyman.cpp | 110 +++++++++++++++++++++++++++++++++++++++++ src/wallet/scriptpubkeyman.h | 46 +++++++++++++++++ 2 files changed, 156 insertions(+) (limited to 'src') diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index f8f5740b38..ea61ab793e 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -1499,3 +1499,113 @@ std::set LegacyScriptPubKeyMan::GetKeys() const } void LegacyScriptPubKeyMan::SetType(OutputType type, bool internal) {} + +bool DescriptorScriptPubKeyMan::GetNewDestination(const OutputType type, CTxDestination& dest, std::string& error) +{ + return false; +} + +isminetype DescriptorScriptPubKeyMan::IsMine(const CScript& script) const +{ + return ISMINE_NO; +} + +bool DescriptorScriptPubKeyMan::CheckDecryptionKey(const CKeyingMaterial& master_key, bool accept_no_keys) +{ + return false; +} + +bool DescriptorScriptPubKeyMan::Encrypt(const CKeyingMaterial& master_key, WalletBatch* batch) +{ + return false; +} + +bool DescriptorScriptPubKeyMan::GetReservedDestination(const OutputType type, bool internal, CTxDestination& address, int64_t& index, CKeyPool& keypool) +{ + return false; +} + +void DescriptorScriptPubKeyMan::ReturnDestination(int64_t index, bool internal, const CTxDestination& addr) +{ +} + +bool DescriptorScriptPubKeyMan::TopUp(unsigned int size) +{ + return false; +} + +void DescriptorScriptPubKeyMan::MarkUnusedAddresses(const CScript& script) +{ +} + +bool DescriptorScriptPubKeyMan::IsHDEnabled() const +{ + return false; +} + +bool DescriptorScriptPubKeyMan::CanGetAddresses(bool internal) const +{ + return false; +} + +bool DescriptorScriptPubKeyMan::HavePrivateKeys() const +{ + return false; +} + +int64_t DescriptorScriptPubKeyMan::GetOldestKeyPoolTime() const +{ + return GetTime(); +} + +size_t DescriptorScriptPubKeyMan::KeypoolCountExternalKeys() const +{ + return 0; +} + +unsigned int DescriptorScriptPubKeyMan::GetKeyPoolSize() const +{ + return 0; +} + +int64_t DescriptorScriptPubKeyMan::GetTimeFirstKey() const +{ + return 0; +} + +std::unique_ptr DescriptorScriptPubKeyMan::GetSolvingProvider(const CScript& script) const +{ + return nullptr; +} + +bool DescriptorScriptPubKeyMan::CanProvide(const CScript& script, SignatureData& sigdata) +{ + return false; +} + +bool DescriptorScriptPubKeyMan::SignTransaction(CMutableTransaction& tx, const std::map& coins, int sighash, std::map& input_errors) const +{ + return false; +} + +SigningResult DescriptorScriptPubKeyMan::SignMessage(const std::string& message, const PKHash& pkhash, std::string& str_sig) const +{ + return SigningResult::SIGNING_FAILED; +} + +TransactionError DescriptorScriptPubKeyMan::FillPSBT(PartiallySignedTransaction& psbt, int sighash_type, bool sign, bool bip32derivs) const +{ + return TransactionError::INVALID_PSBT; +} + +const CKeyMetadata* DescriptorScriptPubKeyMan::GetMetadata(const CTxDestination& dest) const +{ + return nullptr; +} + +uint256 DescriptorScriptPubKeyMan::GetID() const +{ + return uint256(); +} + +void DescriptorScriptPubKeyMan::SetType(OutputType type, bool internal) {} diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h index 0564d0cbc2..24c8af8b4e 100644 --- a/src/wallet/scriptpubkeyman.h +++ b/src/wallet/scriptpubkeyman.h @@ -6,6 +6,7 @@ #define BITCOIN_WALLET_SCRIPTPUBKEYMAN_H #include +#include