@@ -608,6 +608,16 @@ static UniValue decoderawtransaction(const JSONRPCRequest& request)
608
608
return result;
609
609
}
610
610
611
+ static std::string GetAllOutputTypes ()
612
+ {
613
+ std::string ret;
614
+ for (int i = TX_NONSTANDARD; i <= TX_WITNESS_UNKNOWN; ++i) {
615
+ if (i != TX_NONSTANDARD) ret += " , " ;
616
+ ret += GetTxnOutputType (static_cast <txnouttype>(i));
617
+ }
618
+ return ret;
619
+ }
620
+
611
621
static UniValue decodescript (const JSONRPCRequest& request)
612
622
{
613
623
const RPCHelpMan help{" decodescript" ,
@@ -618,14 +628,14 @@ static UniValue decodescript(const JSONRPCRequest& request)
618
628
RPCResult{
619
629
" {\n "
620
630
" \" asm\" :\" asm\" , (string) Script public key\n "
621
- " \" type\" :\" type\" , (string) The output type\n "
631
+ " \" type\" :\" type\" , (string) The output type (e.g. " + GetAllOutputTypes ()+ " ) \n "
622
632
" \" reqSigs\" : n, (numeric) The required signatures\n "
623
633
" \" addresses\" : [ (json array of string)\n "
624
634
" \" address\" (string) bitcoin address\n "
625
635
" ,...\n "
626
636
" ],\n "
627
637
" \" p2sh\" :\" str\" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).\n "
628
- " \" segwit\" : { (json object) Result of a witness script public key wrapping this redeem script (not returned if the script is a P2SH).\n "
638
+ " \" 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 "
629
639
" \" asm\" :\" str\" , (string) String representation of the script public key\n "
630
640
" \" hex\" :\" hexstr\" , (string) Hex string of the script public key\n "
631
641
" \" type\" :\" str\" , (string) The type of the script public key (e.g. witness_v0_keyhash or witness_v0_scripthash)\n "
0 commit comments