@@ -619,15 +619,24 @@ static UniValue decodescript(const JSONRPCRequest& request)
619
619
},
620
620
RPCResult{
621
621
" {\n "
622
- " \" asm\" :\" asm\" , (string) Script public key\n "
623
- " \" hex\" :\" hex\" , (string) hex-encoded public key\n "
624
- " \" type\" :\" type\" , (string) The output type\n "
625
- " \" reqSigs\" : n, (numeric) The required signatures\n "
626
- " \" addresses\" : [ (json array of string)\n "
627
- " \" address\" (string) bitcoin address\n "
622
+ " \" asm\" :\" asm\" , (string) Script public key\n "
623
+ " \" type\" :\" type\" , (string) The output type\n "
624
+ " \" reqSigs\" : n, (numeric) The required signatures\n "
625
+ " \" addresses\" : [ (json array of string)\n "
626
+ " \" address\" (string) bitcoin address\n "
628
627
" ,...\n "
629
628
" ],\n "
630
- " \" p2sh\" ,\" address\" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).\n "
629
+ " \" p2sh\" :\" str\" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).\n "
630
+ " \" segwit\" : { (json object) Result of a witness script public key wrapping this redeem script (not returned if the script is a P2SH).\n "
631
+ " \" asm\" :\" str\" , (string) String representation of the script public key\n "
632
+ " \" hex\" :\" hexstr\" , (string) Hex string of the script public key\n "
633
+ " \" type\" :\" str\" , (string) The type of the script public key (e.g. witness_v0_keyhash or witness_v0_scripthash)\n "
634
+ " \" reqSigs\" : n, (numeric) The required signatures (always 1)\n "
635
+ " \" addresses\" : [ (json array of string) (always length 1)\n "
636
+ " \" address\" (string) segwit address\n "
637
+ " ,...\n "
638
+ " ],\n "
639
+ " \" p2sh-segwit\" :\" str\" (string) address of the P2SH script wrapping this witness redeem script.\n "
631
640
" }\n "
632
641
},
633
642
RPCExamples{
@@ -646,7 +655,7 @@ static UniValue decodescript(const JSONRPCRequest& request)
646
655
} else {
647
656
// Empty scripts are valid
648
657
}
649
- ScriptPubKeyToUniv (script, r, false );
658
+ ScriptPubKeyToUniv (script, r, /* fIncludeHex */ false );
650
659
651
660
UniValue type;
652
661
type = find_value (r, " type" );
@@ -680,7 +689,7 @@ static UniValue decodescript(const JSONRPCRequest& request)
680
689
// Newer segwit program versions should be considered when then become available.
681
690
segwitScr = GetScriptForDestination (WitnessV0ScriptHash (script));
682
691
}
683
- ScriptPubKeyToUniv (segwitScr, sr, true );
692
+ ScriptPubKeyToUniv (segwitScr, sr, /* fIncludeHex */ true );
684
693
sr.pushKV (" p2sh-segwit" , EncodeDestination (CScriptID (segwitScr)));
685
694
r.pushKV (" segwit" , sr);
686
695
}
0 commit comments