@@ -20,6 +20,7 @@ static const std::string OUTPUT_TYPE_STRING_LEGACY = "legacy";
2020static const std::string OUTPUT_TYPE_STRING_P2SH_SEGWIT = " p2sh-segwit" ;
2121static const std::string OUTPUT_TYPE_STRING_BECH32 = " bech32" ;
2222static const std::string OUTPUT_TYPE_STRING_BECH32M = " bech32m" ;
23+ static const std::string OUTPUT_TYPE_STRING_UNKNOWN = " unknown" ;
2324
2425std::optional<OutputType> ParseOutputType (const std::string& type)
2526{
@@ -31,6 +32,8 @@ std::optional<OutputType> ParseOutputType(const std::string& type)
3132 return OutputType::BECH32;
3233 } else if (type == OUTPUT_TYPE_STRING_BECH32M) {
3334 return OutputType::BECH32M;
35+ } else if (type == OUTPUT_TYPE_STRING_UNKNOWN) {
36+ return OutputType::UNKNOWN;
3437 }
3538 return std::nullopt ;
3639}
@@ -42,6 +45,7 @@ const std::string& FormatOutputType(OutputType type)
4245 case OutputType::P2SH_SEGWIT: return OUTPUT_TYPE_STRING_P2SH_SEGWIT;
4346 case OutputType::BECH32: return OUTPUT_TYPE_STRING_BECH32;
4447 case OutputType::BECH32M: return OUTPUT_TYPE_STRING_BECH32M;
48+ case OutputType::UNKNOWN: return OUTPUT_TYPE_STRING_UNKNOWN;
4549 } // no default case, so the compiler can warn about missing cases
4650 assert (false );
4751}
@@ -61,7 +65,8 @@ CTxDestination GetDestinationForKey(const CPubKey& key, OutputType type)
6165 return witdest;
6266 }
6367 }
64- case OutputType::BECH32M: {} // This function should never be used with BECH32M, so let it assert
68+ case OutputType::BECH32M:
69+ case OutputType::UNKNOWN: {} // This function should never be used with BECH32M or UNKNOWN, so let it assert
6570 } // no default case, so the compiler can warn about missing cases
6671 assert (false );
6772}
@@ -101,7 +106,8 @@ CTxDestination AddAndGetDestinationForScript(FillableSigningProvider& keystore,
101106 return ScriptHash (witprog);
102107 }
103108 }
104- case OutputType::BECH32M: {} // This function should not be used for BECH32M, so let it assert
109+ case OutputType::BECH32M:
110+ case OutputType::UNKNOWN: {} // This function should not be used for BECH32M or UNKNOWN, so let it assert
105111 } // no default case, so the compiler can warn about missing cases
106112 assert (false );
107113}
0 commit comments