99993425af rpc: Only allow specific types to be P2(W)SH wrapped in decodescript (MarcoFalke)
Pull request description:
It seems confusing to return a P2SH wrapping address that is eventually either policy- or consensus-unspendable.
ACKs for top commit:
laanwj:
Code review re-ACK 99993425af
Tree-SHA512: 3cd530442acee7c295d244995f0f17b2cae7212f1e0970bb5807621f8ff8e4308a3236b385d77087cd493d32ee524813d8edd15e91d937ef9a800094b7bc4946
{RPCResult::Type::STR,"type","The output type (e.g. "+GetAllOutputTypes()+")"},
{RPCResult::Type::STR,"address",/* optional */true,"The Bitcoin address (only if a well-defined address exists)"},
{RPCResult::Type::STR,"p2sh",/* optional */true,"address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH)"},
{RPCResult::Type::OBJ,"segwit",/* optional */true,"Result of a witness script public key wrapping this redeem script (not returned if the script is a P2SH or witness)",
{RPCResult::Type::STR,"p2sh",/*optional=*/true,
"address of P2SH script wrapping this redeem script (not returned for types that should not be wrapped)"},
{RPCResult::Type::OBJ,"segwit",/*optional=*/true,
"Result of a witness script public key wrapping this redeem script (not returned for types that should not be wrapped)",
{
{RPCResult::Type::STR,"asm","String representation of the script public key"},
{RPCResult::Type::STR_HEX,"hex","Hex string of the script public key"},