MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / SignMessage

Method SignMessage

src/wallet/scriptpubkeyman.cpp:1341–1357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1339}
1340
1341SigningResult DescriptorScriptPubKeyMan::SignMessage(const std::string& message, const PKHash& pkhash, std::string& str_sig) const
1342{
1343 std::unique_ptr<FlatSigningProvider> keys = GetSigningProvider(GetScriptForDestination(pkhash), true);
1344 if (!keys) {
1345 return SigningResult::PRIVATE_KEY_NOT_AVAILABLE;
1346 }
1347
1348 CKey key;
1349 if (!keys->GetKey(ToKeyID(pkhash), key)) {
1350 return SigningResult::PRIVATE_KEY_NOT_AVAILABLE;
1351 }
1352
1353 if (!MessageSign(key, message, str_sig)) {
1354 return SigningResult::SIGNING_FAILED;
1355 }
1356 return SigningResult::OK;
1357}
1358
1359std::optional<PSBTError> DescriptorScriptPubKeyMan::FillPSBT(PartiallySignedTransaction& psbtx, const PrecomputedTransactionData& txdata, const common::PSBTFillOptions& options, int* n_signed) const
1360{

Callers

nothing calls this directly

Calls 4

GetScriptForDestinationFunction · 0.85
ToKeyIDFunction · 0.85
MessageSignFunction · 0.85
GetKeyMethod · 0.45

Tested by

no test coverage detected