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

Function SignTransaction

src/rpc/rawtransaction_util.cpp:312–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312void SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, const UniValue& hashType, UniValue& result)
313{
314 std::optional<int> nHashType = ParseSighashString(hashType);
315 if (!nHashType) {
316 nHashType = SIGHASH_DEFAULT;
317 }
318
319 // Script verification errors
320 std::map<int, bilingual_str> input_errors;
321
322 bool complete = SignTransaction(mtx, keystore, coins, {.sighash_type = *nHashType}, input_errors);
323 SignTransactionResultToJSON(mtx, complete, coins, input_errors, result);
324}
325
326void SignTransactionResultToJSON(CMutableTransaction& mtx, bool complete, const std::map<COutPoint, Coin>& coins, const std::map<int, bilingual_str>& input_errors, UniValue& result)
327{

Callers 1

Calls 2

ParseSighashStringFunction · 0.85

Tested by

no test coverage detected