Skip to content

Commit

Permalink
Implement GetID for DescriptorScriptPubKeyMan
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Apr 23, 2020
1 parent ec2f9e1 commit 46c46ae
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 @@ -1621,7 +1621,11 @@ const CKeyMetadata* DescriptorScriptPubKeyMan::GetMetadata(const CTxDestination&

uint256 DescriptorScriptPubKeyMan::GetID() const
{
return uint256();
LOCK(cs_desc_man);
std::string desc_str = m_wallet_descriptor.descriptor->ToString();
uint256 id;
CSHA256().Write((unsigned char*)desc_str.data(), desc_str.size()).Finalize(id.begin());
return id;
}

void DescriptorScriptPubKeyMan::SetType(OutputType type, bool internal)
Expand Down

0 comments on commit 46c46ae

Please sign in to comment.