MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / TxInErrorToJSON

Function TxInErrorToJSON

src/rpc/rawtransaction.cpp:663–677  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

661
662/** Pushes a JSON object for script verification or signing errors to vErrorsRet. */
663static void TxInErrorToJSON(const CTxIn& txin, UniValue& vErrorsRet, const std::string& strMessage)
664{
665 UniValue entry(UniValue::VOBJ);
666 entry.pushKV("txid", txin.prevout.hash.ToString());
667 entry.pushKV("vout", (uint64_t)txin.prevout.n);
668 UniValue witness(UniValue::VARR);
669 for (unsigned int i = 0; i < txin.scriptWitness.stack.size(); i++) {
670 witness.push_back(HexStr(txin.scriptWitness.stack[i].begin(), txin.scriptWitness.stack[i].end()));
671 }
672 entry.pushKV("witness", witness);
673 entry.pushKV("scriptSig", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()));
674 entry.pushKV("sequence", (uint64_t)txin.nSequence);
675 entry.pushKV("error", strMessage);
676 vErrorsRet.push_back(entry);
677}
678
679static UniValue combinerawtransaction(const JSONRPCRequest& request)
680{

Callers 1

SignTransactionFunction · 0.85

Calls 7

HexStrFunction · 0.85
pushKVMethod · 0.45
ToStringMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected