MCPcopy Create free account
hub / github.com/ElementsProject/elements / TxInErrorToJSON

Function TxInErrorToJSON

src/rpc/rawtransaction_util.cpp:399–413  ·  view source on GitHub ↗

Pushes a JSON object for script verification or signing errors to vErrorsRet. */

Source from the content-addressed store, hash-verified

397
398/** Pushes a JSON object for script verification or signing errors to vErrorsRet. */
399static void TxInErrorToJSON(const CTxIn& txin, const CTxInWitness& txinwit, UniValue& vErrorsRet, const std::string& strMessage)
400{
401 UniValue entry(UniValue::VOBJ);
402 entry.pushKV("txid", txin.prevout.hash.ToString());
403 entry.pushKV("vout", (uint64_t)txin.prevout.n);
404 UniValue witness(UniValue::VARR);
405 for (unsigned int i = 0; i < txinwit.scriptWitness.stack.size(); i++) {
406 witness.push_back(HexStr(txinwit.scriptWitness.stack[i]));
407 }
408 entry.pushKV("witness", witness);
409 entry.pushKV("scriptSig", HexStr(txin.scriptSig));
410 entry.pushKV("sequence", (uint64_t)txin.nSequence);
411 entry.pushKV("error", strMessage);
412 vErrorsRet.push_back(entry);
413}
414
415void ParsePrevouts(const UniValue& prevTxsUnival, FillableSigningProvider* keystore, std::map<COutPoint, Coin>& coins)
416{

Callers 1

Calls 5

HexStrFunction · 0.50
pushKVMethod · 0.45
ToStringMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected