Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 1,141 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < mtx.vin.size(); i++) { | ||||
sigdata, DataFromTransaction(mtx, i)); | sigdata, DataFromTransaction(mtx, i)); | ||||
UpdateTransaction(mtx, i, sigdata); | UpdateTransaction(mtx, i, sigdata); | ||||
ScriptError serror = SCRIPT_ERR_OK; | ScriptError serror = SCRIPT_ERR_OK; | ||||
if (!VerifyScript( | if (!VerifyScript( | ||||
txin.scriptSig, prevPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, | txin.scriptSig, prevPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, | ||||
TransactionSignatureChecker(&txConst, i, amount), &serror)) { | TransactionSignatureChecker(&txConst, i, amount), &serror)) { | ||||
if (serror == SCRIPT_ERR_INVALID_STACK_OPERATION) { | |||||
// Unable to sign input and verification failed (possible | |||||
// attempt to partially sign). | |||||
TxInErrorToJSON(txin, vErrors, "Unable to sign input, invalid " | |||||
"stack size (possibly missing " | |||||
"key)"); | |||||
} else { | |||||
TxInErrorToJSON(txin, vErrors, ScriptErrorString(serror)); | TxInErrorToJSON(txin, vErrors, ScriptErrorString(serror)); | ||||
} | } | ||||
} | } | ||||
} | |||||
bool fComplete = vErrors.empty(); | bool fComplete = vErrors.empty(); | ||||
UniValue result(UniValue::VOBJ); | UniValue result(UniValue::VOBJ); | ||||
result.pushKV("hex", EncodeHexTx(CTransaction(mtx))); | result.pushKV("hex", EncodeHexTx(CTransaction(mtx))); | ||||
result.pushKV("complete", fComplete); | result.pushKV("complete", fComplete); | ||||
if (!vErrors.empty()) { | if (!vErrors.empty()) { | ||||
result.pushKV("errors", vErrors); | result.pushKV("errors", vErrors); | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |