aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/scriptpubkeyman.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2019-11-06 20:55:34 -0500
committerAndrew Chow <achow101-github@achow101.com>2020-04-23 13:59:48 -0400
commit8b9603bd0b443e2f7984eb72bf2e21cf02af0bcb (patch)
tree23d675917d739aa53e18578fab0aed6996d19472 /src/wallet/scriptpubkeyman.cpp
parent72a9540df96ffdb94f039b9c14eaacdc7d961196 (diff)
downloadbitcoin-8b9603bd0b443e2f7984eb72bf2e21cf02af0bcb.tar.xz
Change GetMetadata to use unique_ptr<CKeyMetadata>
Diffstat (limited to 'src/wallet/scriptpubkeyman.cpp')
-rw-r--r--src/wallet/scriptpubkeyman.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp
index 0c1da43b48..e10c248c64 100644
--- a/src/wallet/scriptpubkeyman.cpp
+++ b/src/wallet/scriptpubkeyman.cpp
@@ -568,7 +568,7 @@ TransactionError LegacyScriptPubKeyMan::FillPSBT(PartiallySignedTransaction& psb
return TransactionError::OK;
}
-const CKeyMetadata* LegacyScriptPubKeyMan::GetMetadata(const CTxDestination& dest) const
+std::unique_ptr<CKeyMetadata> LegacyScriptPubKeyMan::GetMetadata(const CTxDestination& dest) const
{
LOCK(cs_KeyStore);
@@ -576,14 +576,14 @@ const CKeyMetadata* LegacyScriptPubKeyMan::GetMetadata(const CTxDestination& des
if (!key_id.IsNull()) {
auto it = mapKeyMetadata.find(key_id);
if (it != mapKeyMetadata.end()) {
- return &it->second;
+ return MakeUnique<CKeyMetadata>(it->second);
}
}
CScript scriptPubKey = GetScriptForDestination(dest);
auto it = m_script_metadata.find(CScriptID(scriptPubKey));
if (it != m_script_metadata.end()) {
- return &it->second;
+ return MakeUnique<CKeyMetadata>(it->second);
}
return nullptr;
@@ -2041,7 +2041,7 @@ TransactionError DescriptorScriptPubKeyMan::FillPSBT(PartiallySignedTransaction&
return TransactionError::OK;
}
-const CKeyMetadata* DescriptorScriptPubKeyMan::GetMetadata(const CTxDestination& dest) const
+std::unique_ptr<CKeyMetadata> DescriptorScriptPubKeyMan::GetMetadata(const CTxDestination& dest) const
{
return nullptr;
}