mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
refactor: unify container presence checks - non-trivial counts
The changes made here were: | From | To | |-------------------|------------------| | `m.count(k) == 1` | `m.contains(k)` | | `m.count(k) == 0` | `!m.contains(k)` | | `m.count(k) != 1` | `!m.contains(k)` | | `m.count(k) < 1` | `!m.contains(k)` | * `mapInfo` is instance of `std::unordered_map` and can only contain 0 or 1 value for a given key; * similarly, `g_enabled_filter_types` and `setClientRules` are both `std::set` instances; * lastly, while `mapTxSpends` is `std::unordered_multimap` that could potentially hold multiple values, having a size less than 1 means that the value is missing. `QMap<WalletModel*, WalletView*> mapWalletViews` values were also migrated manually. Co-authored-by: pablomartin4btc <pablomartin4btc@gmail.com> Co-authored-by: fanquake <fanquake@gmail.com>
This commit is contained in:
@@ -968,7 +968,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
|
||||
|
||||
// Signal NODE_COMPACT_FILTERS if peerblockfilters and basic filters index are both enabled.
|
||||
if (args.GetBoolArg("-peerblockfilters", DEFAULT_PEERBLOCKFILTERS)) {
|
||||
if (g_enabled_filter_types.count(BlockFilterType::BASIC) != 1) {
|
||||
if (!g_enabled_filter_types.contains(BlockFilterType::BASIC)) {
|
||||
return InitError(_("Cannot set -peerblockfilters without -blockfilterindex."));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user