Skip to content

Commit fa927ff

Browse files
author
MarcoFalke
committed
Enable Wswitch for OutputType
1 parent faddad7 commit fa927ff

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/outputtype.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ const std::string& FormatOutputType(OutputType type)
4242
case OutputType::LEGACY: return OUTPUT_TYPE_STRING_LEGACY;
4343
case OutputType::P2SH_SEGWIT: return OUTPUT_TYPE_STRING_P2SH_SEGWIT;
4444
case OutputType::BECH32: return OUTPUT_TYPE_STRING_BECH32;
45-
default: assert(false);
46-
}
45+
} // no default case, so the compiler can warn about missing cases
46+
assert(false);
4747
}
4848

4949
CTxDestination GetDestinationForKey(const CPubKey& key, OutputType type)
@@ -61,8 +61,8 @@ CTxDestination GetDestinationForKey(const CPubKey& key, OutputType type)
6161
return witdest;
6262
}
6363
}
64-
default: assert(false);
65-
}
64+
} // no default case, so the compiler can warn about missing cases
65+
assert(false);
6666
}
6767

6868
std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey& key)
@@ -100,6 +100,6 @@ CTxDestination AddAndGetDestinationForScript(FillableSigningProvider& keystore,
100100
return ScriptHash(witprog);
101101
}
102102
}
103-
default: assert(false);
104-
}
103+
} // no default case, so the compiler can warn about missing cases
104+
assert(false);
105105
}

src/wallet/scriptpubkeyman.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,8 +1900,8 @@ bool DescriptorScriptPubKeyMan::SetupDescriptorGeneration(const CExtKey& master_
19001900
desc_prefix = "wpkh(" + xpub + "/84'";
19011901
break;
19021902
}
1903-
default: assert(false);
1904-
}
1903+
} // no default case, so the compiler can warn about missing cases
1904+
assert(!desc_prefix.empty());
19051905

19061906
// Mainnet derives at 0', testnet and regtest derive at 1'
19071907
if (Params().IsTestChain()) {

0 commit comments

Comments
 (0)