rpc: Mention all output types in decodescript doc

This commit is contained in:
MarcoFalke 2019-03-20 15:54:37 -04:00
parent fa3caa1666
commit fa926ec24f
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -608,6 +608,16 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request)
return result;
}
static std::string GetAllOutputTypes()
{
std::string ret;
for (int i = TX_NONSTANDARD; i <= TX_WITNESS_UNKNOWN; ++i) {
if (i != TX_NONSTANDARD) ret += ", ";
ret += GetTxnOutputType(static_cast<txnouttype>(i));
}
return ret;
}
static UniValue decodescript(const JSONRPCRequest& request)
{
const RPCHelpMan help{"decodescript",
@ -618,14 +628,14 @@ static UniValue decodescript(const JSONRPCRequest& request)
RPCResult{
"{\n"
" \"asm\":\"asm\", (string) Script public key\n"
" \"type\":\"type\", (string) The output type\n"
" \"type\":\"type\", (string) The output type (e.g. "+GetAllOutputTypes()+")\n"
" \"reqSigs\": n, (numeric) The required signatures\n"
" \"addresses\": [ (json array of string)\n"
" \"address\" (string) bitcoin address\n"
" ,...\n"
" ],\n"
" \"p2sh\":\"str\" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).\n"
" \"segwit\": { (json object) Result of a witness script public key wrapping this redeem script (not returned if the script is a P2SH).\n"
" \"segwit\": { (json object) Result of a witness script public key wrapping this redeem script (not returned if the script is a P2SH or witness).\n"
" \"asm\":\"str\", (string) String representation of the script public key\n"
" \"hex\":\"hexstr\", (string) Hex string of the script public key\n"
" \"type\":\"str\", (string) The type of the script public key (e.g. witness_v0_keyhash or witness_v0_scripthash)\n"