Merge bitcoin/bitcoin#25869: wallet: remove UNKNOWN type from OUTPUT_TYPES array

5b4fdbbff5 wallet: remove UNKNOWN type from OUTPUT_TYPES array (furszy)

Pull request description:

  Fixing https://github.com/bitcoin/bitcoin/pull/25734#discussion_r949502998 ->  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50329

  The `OUTPUT_TYPES` array contain the known active output types only.
  And it's solely used to create/walk-through the active spkms.

  So, no need to add the `UNKNOWN` type here.

ACKs for top commit:
  achow101:
    ACK 5b4fdbbff5
  w0xlt:
    ACK 5b4fdbbff5
  LarryRuane:
    ACK 5b4fdbbff5

Tree-SHA512: dee2dc362a1b0c777555e5ee4d355a3351340591d0096f74e8c3a25f374cb2d9aef26145977ff4dd0f8cc940da9464eb5541eb2895bc19f8cbd6bb6d292ab9a9
pull/25878/head
Andrew Chow 2 years ago
commit 0f0508bc72
No known key found for this signature in database
GPG Key ID: 17565732E08E5E41

@ -27,7 +27,6 @@ static constexpr auto OUTPUT_TYPES = std::array{
OutputType::P2SH_SEGWIT, OutputType::P2SH_SEGWIT,
OutputType::BECH32, OutputType::BECH32,
OutputType::BECH32M, OutputType::BECH32M,
OutputType::UNKNOWN,
}; };
std::optional<OutputType> ParseOutputType(const std::string& str); std::optional<OutputType> ParseOutputType(const std::string& str);

@ -3446,7 +3446,6 @@ void CWallet::SetupDescriptorScriptPubKeyMans()
for (bool internal : {false, true}) { for (bool internal : {false, true}) {
for (OutputType t : OUTPUT_TYPES) { for (OutputType t : OUTPUT_TYPES) {
if (t == OutputType::UNKNOWN) continue;
auto spk_manager = std::unique_ptr<DescriptorScriptPubKeyMan>(new DescriptorScriptPubKeyMan(*this)); auto spk_manager = std::unique_ptr<DescriptorScriptPubKeyMan>(new DescriptorScriptPubKeyMan(*this));
if (IsCrypted()) { if (IsCrypted()) {
if (IsLocked()) { if (IsLocked()) {

Loading…
Cancel
Save