Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 1,918 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
"feerate of the final signed transaction in " + | "feerate of the final signed transaction in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
"/kB. Shown only if all UTXO slots in the PSBT have been filled.\n" | "/kB. Shown only if all UTXO slots in the PSBT have been filled.\n" | ||||
" \"fee\" : fee (numeric, optional) The " | " \"fee\" : fee (numeric, optional) The " | ||||
"transaction fee paid. Shown only if all UTXO slots in the PSBT " | "transaction fee paid. Shown only if all UTXO slots in the PSBT " | ||||
"have been filled.\n" | "have been filled.\n" | ||||
" \"next\" : \"role\" (string) Role of the next " | " \"next\" : \"role\" (string) Role of the next " | ||||
"person that this psbt needs to go to\n" | "person that this psbt needs to go to\n" | ||||
" \"error\" : \"error\" (string) Error message if " | |||||
"there is one" | |||||
"}\n"}, | "}\n"}, | ||||
RPCExamples{HelpExampleCli("analyzepsbt", "\"psbt\"")}} | RPCExamples{HelpExampleCli("analyzepsbt", "\"psbt\"")}} | ||||
.Check(request); | .Check(request); | ||||
RPCTypeCheck(request.params, {UniValue::VSTR}); | RPCTypeCheck(request.params, {UniValue::VSTR}); | ||||
// Unserialize the transaction | // Unserialize the transaction | ||||
PartiallySignedTransaction psbtx; | PartiallySignedTransaction psbtx; | ||||
Show All 32 Lines | for (const auto &input : psbta.inputs) { | ||||
} | } | ||||
missing.pushKV("signatures", missing_sigs_univ); | missing.pushKV("signatures", missing_sigs_univ); | ||||
} | } | ||||
if (!missing.getKeys().empty()) { | if (!missing.getKeys().empty()) { | ||||
input_univ.pushKV("missing", missing); | input_univ.pushKV("missing", missing); | ||||
} | } | ||||
inputs_result.push_back(input_univ); | inputs_result.push_back(input_univ); | ||||
} | } | ||||
if (!inputs_result.empty()) { | |||||
result.pushKV("inputs", inputs_result); | result.pushKV("inputs", inputs_result); | ||||
} | |||||
if (psbta.estimated_vsize != nullopt) { | if (psbta.estimated_vsize != nullopt) { | ||||
result.pushKV("estimated_vsize", (int)*psbta.estimated_vsize); | result.pushKV("estimated_vsize", (int)*psbta.estimated_vsize); | ||||
} | } | ||||
if (psbta.estimated_feerate != nullopt) { | if (psbta.estimated_feerate != nullopt) { | ||||
result.pushKV("estimated_feerate", | result.pushKV("estimated_feerate", | ||||
ValueFromAmount(psbta.estimated_feerate->GetFeePerK())); | ValueFromAmount(psbta.estimated_feerate->GetFeePerK())); | ||||
} | } | ||||
if (psbta.fee != nullopt) { | if (psbta.fee != nullopt) { | ||||
result.pushKV("fee", ValueFromAmount(*psbta.fee)); | result.pushKV("fee", ValueFromAmount(*psbta.fee)); | ||||
} | } | ||||
result.pushKV("next", PSBTRoleName(psbta.next)); | result.pushKV("next", PSBTRoleName(psbta.next)); | ||||
if (!psbta.error.empty()) { | |||||
result.pushKV("error", psbta.error); | |||||
} | |||||
return result; | return result; | ||||
} | } | ||||
// clang-format off | // clang-format off | ||||
static const CRPCCommand commands[] = { | static const CRPCCommand commands[] = { | ||||
// category name actor (function) argNames | // category name actor (function) argNames | ||||
// ------------------- ------------------------ ---------------------- ---------- | // ------------------- ------------------------ ---------------------- ---------- | ||||
Show All 26 Lines |