mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge #13429: Return the script type from Solver
984d72ec65 Return the script type from Solver (Ben Woosley)
Pull request description:
Because false is synonymous with TX_NONSTANDARD, this conveys the same
information and makes the handling explicitly based on script type,
simplifying each call site.
Prior to this change it was common for the return value to be ignored, or for the
return value and TX_NONSTANDARD to be redundantly handled.
Tree-SHA512: 31864f856b8cb75f4b782d12678070e8b1cfe9665c6f57cfb25e7ac8bcea8a22f9a78d7c8cf0101c841f2a612400666fb91798bffe88de856e98b873703b0965
This commit is contained in:
@@ -626,9 +626,8 @@ static UniValue decodescript(const JSONRPCRequest& request)
|
||||
// P2SH and witness programs cannot be wrapped in P2WSH, if this script
|
||||
// is a witness program, don't return addresses for a segwit programs.
|
||||
if (type.get_str() == "pubkey" || type.get_str() == "pubkeyhash" || type.get_str() == "multisig" || type.get_str() == "nonstandard") {
|
||||
txnouttype which_type;
|
||||
std::vector<std::vector<unsigned char>> solutions_data;
|
||||
Solver(script, which_type, solutions_data);
|
||||
txnouttype which_type = Solver(script, solutions_data);
|
||||
// Uncompressed pubkeys cannot be used with segwit checksigs.
|
||||
// If the script contains an uncompressed pubkey, skip encoding of a segwit program.
|
||||
if ((which_type == TX_PUBKEY) || (which_type == TX_MULTISIG)) {
|
||||
|
||||
Reference in New Issue
Block a user