@@ -20,6 +20,7 @@ static const std::string OUTPUT_TYPE_STRING_LEGACY = "legacy";
20
20
static const std::string OUTPUT_TYPE_STRING_P2SH_SEGWIT = " p2sh-segwit" ;
21
21
static const std::string OUTPUT_TYPE_STRING_BECH32 = " bech32" ;
22
22
static const std::string OUTPUT_TYPE_STRING_BECH32M = " bech32m" ;
23
+ static const std::string OUTPUT_TYPE_STRING_UNKNOWN = " unknown" ;
23
24
24
25
std::optional<OutputType> ParseOutputType (const std::string& type)
25
26
{
@@ -31,6 +32,8 @@ std::optional<OutputType> ParseOutputType(const std::string& type)
31
32
return OutputType::BECH32;
32
33
} else if (type == OUTPUT_TYPE_STRING_BECH32M) {
33
34
return OutputType::BECH32M;
35
+ } else if (type == OUTPUT_TYPE_STRING_UNKNOWN) {
36
+ return OutputType::UNKNOWN;
34
37
}
35
38
return std::nullopt;
36
39
}
@@ -42,6 +45,7 @@ const std::string& FormatOutputType(OutputType type)
42
45
case OutputType::P2SH_SEGWIT: return OUTPUT_TYPE_STRING_P2SH_SEGWIT;
43
46
case OutputType::BECH32: return OUTPUT_TYPE_STRING_BECH32;
44
47
case OutputType::BECH32M: return OUTPUT_TYPE_STRING_BECH32M;
48
+ case OutputType::UNKNOWN: return OUTPUT_TYPE_STRING_UNKNOWN;
45
49
} // no default case, so the compiler can warn about missing cases
46
50
assert (false );
47
51
}
@@ -61,7 +65,8 @@ CTxDestination GetDestinationForKey(const CPubKey& key, OutputType type)
61
65
return witdest;
62
66
}
63
67
}
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
65
70
} // no default case, so the compiler can warn about missing cases
66
71
assert (false );
67
72
}
@@ -101,7 +106,8 @@ CTxDestination AddAndGetDestinationForScript(FillableSigningProvider& keystore,
101
106
return ScriptHash (witprog);
102
107
}
103
108
}
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
105
111
} // no default case, so the compiler can warn about missing cases
106
112
assert (false );
107
113
}
0 commit comments