mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Implement GetMetadata in DescriptorScriptPubKeyMan
This commit is contained in:
parent
8b9603bd0b
commit
b713baa75a
1 changed files with 13 additions and 0 deletions
|
|
@ -2043,6 +2043,19 @@ TransactionError DescriptorScriptPubKeyMan::FillPSBT(PartiallySignedTransaction&
|
|||
|
||||
std::unique_ptr<CKeyMetadata> DescriptorScriptPubKeyMan::GetMetadata(const CTxDestination& dest) const
|
||||
{
|
||||
std::unique_ptr<SigningProvider> provider = GetSigningProvider(GetScriptForDestination(dest));
|
||||
if (provider) {
|
||||
KeyOriginInfo orig;
|
||||
CKeyID key_id = GetKeyForDestination(*provider, dest);
|
||||
if (provider->GetKeyOrigin(key_id, orig)) {
|
||||
LOCK(cs_desc_man);
|
||||
std::unique_ptr<CKeyMetadata> meta = MakeUnique<CKeyMetadata>();
|
||||
meta->key_origin = orig;
|
||||
meta->has_key_origin = true;
|
||||
meta->nCreateTime = m_wallet_descriptor.creation_time;
|
||||
return meta;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue