Skip to content

Commit

Permalink
Implement IsMine for DescriptorScriptPubKeyMan
Browse files Browse the repository at this point in the history
Adds a set of scriptPubKeys that DescriptorScriptPubKeyMan tracks.
If the given script is in that set, it is considered ISMINE_SPENDABLE
  • Loading branch information
achow101 committed Apr 23, 2020
1 parent db7177a commit 2db7ca7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/wallet/scriptpubkeyman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -1580,7 +1584,7 @@ std::unique_ptr<SigningProvider> DescriptorScriptPubKeyMan::GetSolvingProvider(c

bool DescriptorScriptPubKeyMan::CanProvide(const CScript& script, SignatureData& sigdata)
{
return false;
return IsMine(script);
}

bool DescriptorScriptPubKeyMan::SignTransaction(CMutableTransaction& tx, const std::map<COutPoint, Coin>& coins, int sighash, std::map<int, std::string>& input_errors) const
Expand Down

0 comments on commit 2db7ca7

Please sign in to comment.