Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/scriptpubkeyman.cpp
Show First 20 Lines • Show All 459 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
bool LegacyScriptPubKeyMan::SignTransaction( | bool LegacyScriptPubKeyMan::SignTransaction( | ||||
CMutableTransaction &tx, const std::map<COutPoint, Coin> &coins, | CMutableTransaction &tx, const std::map<COutPoint, Coin> &coins, | ||||
SigHashType sighash, std::map<int, std::string> &input_errors) const { | SigHashType sighash, std::map<int, std::string> &input_errors) const { | ||||
return ::SignTransaction(tx, this, coins, sighash, input_errors); | return ::SignTransaction(tx, this, coins, sighash, input_errors); | ||||
} | } | ||||
SigningResult LegacyScriptPubKeyMan::SignMessage(const std::string &message, | |||||
const PKHash &pkhash, | |||||
std::string &str_sig) const { | |||||
CKeyID key_id(pkhash); | |||||
CKey key; | |||||
if (!GetKey(key_id, key)) { | |||||
return SigningResult::PRIVATE_KEY_NOT_AVAILABLE; | |||||
} | |||||
if (MessageSign(key, message, str_sig)) { | |||||
return SigningResult::OK; | |||||
} | |||||
return SigningResult::SIGNING_FAILED; | |||||
} | |||||
TransactionError | TransactionError | ||||
LegacyScriptPubKeyMan::FillPSBT(PartiallySignedTransaction &psbtx, | LegacyScriptPubKeyMan::FillPSBT(PartiallySignedTransaction &psbtx, | ||||
SigHashType sighash_type, bool sign, | SigHashType sighash_type, bool sign, | ||||
bool bip32derivs) const { | bool bip32derivs) const { | ||||
for (size_t i = 0; i < psbtx.tx->vin.size(); ++i) { | for (size_t i = 0; i < psbtx.tx->vin.size(); ++i) { | ||||
PSBTInput &input = psbtx.inputs.at(i); | PSBTInput &input = psbtx.inputs.at(i); | ||||
if (PSBTInputSigned(input)) { | if (PSBTInputSigned(input)) { | ||||
▲ Show 20 Lines • Show All 1,027 Lines • Show Last 20 Lines |