Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/scriptpubkeyman.cpp
// Copyright (c) 2019 The Bitcoin Core developers | // Copyright (c) 2019 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <config.h> | #include <config.h> | ||||
#include <key_io.h> | #include <key_io.h> | ||||
#include <outputtype.h> | #include <outputtype.h> | ||||
#include <script/descriptor.h> | #include <script/descriptor.h> | ||||
#include <script/sign.h> | |||||
#include <util/bip32.h> | #include <util/bip32.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <util/translation.h> | #include <util/translation.h> | ||||
#include <wallet/scriptpubkeyman.h> | #include <wallet/scriptpubkeyman.h> | ||||
bool LegacyScriptPubKeyMan::GetNewDestination(const OutputType type, | bool LegacyScriptPubKeyMan::GetNewDestination(const OutputType type, | ||||
CTxDestination &dest, | CTxDestination &dest, | ||||
std::string &error) { | std::string &error) { | ||||
▲ Show 20 Lines • Show All 436 Lines • ▼ Show 20 Lines | if (!sigdata.signatures.empty()) { | ||||
for (const auto &key_sig_pair : sigdata.signatures) { | for (const auto &key_sig_pair : sigdata.signatures) { | ||||
has_privkeys |= HaveKey(key_sig_pair.first); | has_privkeys |= HaveKey(key_sig_pair.first); | ||||
} | } | ||||
return has_privkeys; | return has_privkeys; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
bool LegacyScriptPubKeyMan::SignTransaction( | |||||
CMutableTransaction &tx, const std::map<COutPoint, Coin> &coins, | |||||
SigHashType sighash, std::map<int, std::string> &input_errors) const { | |||||
return ::SignTransaction(tx, this, coins, sighash, input_errors); | |||||
} | |||||
const CKeyMetadata * | const 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()) { | ||||
▲ Show 20 Lines • Show All 984 Lines • Show Last 20 Lines |