Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
251});252return result;253}255bool OnlyHasDefaultSectionSetting(const Settings& settings, const std::string& section, const std::string& name)256{257bool has_default_section_setting = false;258bool has_other_setting = false;259MergeSettings(settings, section, name, [&](SettingsSpan span, Source source) {260if (span.empty()) return;261else if (source == Source::CONFIG_FILE_DEFAULT_SECTION) has_default_section_setting = true;262else has_other_setting = true;263});264// If a value is set in the default section and not explicitly overwritten by the265// user on the command line or in a different section, then we want to enable266// warnings about the value being ignored.267return has_default_section_setting && !has_other_setting;268}270SettingsSpan::SettingsSpan(const std::vector<SettingsValue>& vec) noexcept : SettingsSpan(vec.data(), vec.size()) {}271const SettingsValue* SettingsSpan::begin() const { return data + negated(); }272const SettingsValue* SettingsSpan::end() const { return data + size; }273bool SettingsSpan::empty() const { return size == 0 || last_negated(); }274bool SettingsSpan::last_negated() const { return size > 0 && data[size - 1].isFalse(); }275size_t SettingsSpan::negated() const276{277for (size_t i = size; i > 0; --i) {278if (data[i - 1].isFalse()) return i; // Return number of negated values (position of last false value)279}280return 0;281}283} // namespace common
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.