From 2db7ca765c8fb2c71dd6f7c4f29ad70e68ff1720 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Fri, 5 Jul 2019 18:33:55 -0400 Subject: Implement IsMine for DescriptorScriptPubKeyMan Adds a set of scriptPubKeys that DescriptorScriptPubKeyMan tracks. If the given script is in that set, it is considered ISMINE_SPENDABLE --- src/wallet/scriptpubkeyman.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/wallet') diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index c825438f99..88563459bc 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -1507,6 +1507,10 @@ bool DescriptorScriptPubKeyMan::GetNewDestination(const OutputType type, CTxDest isminetype DescriptorScriptPubKeyMan::IsMine(const CScript& script) const { + LOCK(cs_desc_man); + if (m_map_script_pub_keys.count(script) > 0) { + return ISMINE_SPENDABLE; + } return ISMINE_NO; } @@ -1580,7 +1584,7 @@ std::unique_ptr DescriptorScriptPubKeyMan::GetSolvingProvider(c bool DescriptorScriptPubKeyMan::CanProvide(const CScript& script, SignatureData& sigdata) { - return false; + return IsMine(script); } bool DescriptorScriptPubKeyMan::SignTransaction(CMutableTransaction& tx, const std::map& coins, int sighash, std::map& input_errors) const -- cgit v1.2.3