Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/scriptpubkeyman.cpp
Show First 20 Lines • Show All 518 Lines • ▼ Show 20 Lines | LegacyScriptPubKeyMan::FillPSBT(PartiallySignedTransaction &psbtx, | ||||
for (size_t i = 0; i < psbtx.tx->vout.size(); ++i) { | for (size_t i = 0; i < psbtx.tx->vout.size(); ++i) { | ||||
UpdatePSBTOutput(HidingSigningProvider(this, true, !bip32derivs), psbtx, | UpdatePSBTOutput(HidingSigningProvider(this, true, !bip32derivs), psbtx, | ||||
i); | i); | ||||
} | } | ||||
return TransactionError::OK; | return TransactionError::OK; | ||||
} | } | ||||
const CKeyMetadata * | std::unique_ptr<CKeyMetadata> | ||||
LegacyScriptPubKeyMan::GetMetadata(const CTxDestination &dest) const { | LegacyScriptPubKeyMan::GetMetadata(const CTxDestination &dest) const { | ||||
LOCK(cs_KeyStore); | LOCK(cs_KeyStore); | ||||
CKeyID key_id = GetKeyForDestination(*this, dest); | CKeyID key_id = GetKeyForDestination(*this, dest); | ||||
if (!key_id.IsNull()) { | if (!key_id.IsNull()) { | ||||
auto it = mapKeyMetadata.find(key_id); | auto it = mapKeyMetadata.find(key_id); | ||||
if (it != mapKeyMetadata.end()) { | if (it != mapKeyMetadata.end()) { | ||||
return &it->second; | return std::make_unique<CKeyMetadata>(it->second); | ||||
} | } | ||||
} | } | ||||
CScript scriptPubKey = GetScriptForDestination(dest); | CScript scriptPubKey = GetScriptForDestination(dest); | ||||
auto it = m_script_metadata.find(CScriptID(scriptPubKey)); | auto it = m_script_metadata.find(CScriptID(scriptPubKey)); | ||||
if (it != m_script_metadata.end()) { | if (it != m_script_metadata.end()) { | ||||
return &it->second; | return std::make_unique<CKeyMetadata>(it->second); | ||||
} | } | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
uint256 LegacyScriptPubKeyMan::GetID() const { | uint256 LegacyScriptPubKeyMan::GetID() const { | ||||
return UINT256_ONE(); | return UINT256_ONE(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,567 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < psbtx.tx->vout.size(); ++i) { | ||||
} | } | ||||
UpdatePSBTOutput(HidingSigningProvider(keys.get(), true, !bip32derivs), | UpdatePSBTOutput(HidingSigningProvider(keys.get(), true, !bip32derivs), | ||||
psbtx, i); | psbtx, i); | ||||
} | } | ||||
return TransactionError::OK; | return TransactionError::OK; | ||||
} | } | ||||
const CKeyMetadata * | std::unique_ptr<CKeyMetadata> | ||||
DescriptorScriptPubKeyMan::GetMetadata(const CTxDestination &dest) const { | DescriptorScriptPubKeyMan::GetMetadata(const CTxDestination &dest) const { | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
uint256 DescriptorScriptPubKeyMan::GetID() const { | uint256 DescriptorScriptPubKeyMan::GetID() const { | ||||
LOCK(cs_desc_man); | LOCK(cs_desc_man); | ||||
std::string desc_str = m_wallet_descriptor.descriptor->ToString(); | std::string desc_str = m_wallet_descriptor.descriptor->ToString(); | ||||
uint256 id; | uint256 id; | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |