mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 21:52:38 +01:00
introduce and use the generalized node::Warnings interface
Instead of having separate warning functions (and globals) for each different warning that can be raised, encapsulate this logic into a single class and allow to (un)set any number of warnings. Introduces behaviour change: - the `-alertnotify` command is executed for all `KernelNotifications::warningSet` calls, which now also covers the `LARGE_WORK_INVALID_CHAIN` warning. - previously, warnings were returned based on a predetermined order, e.g. with the "pre-release test build" warning always first. This is no longer the case, and Warnings::GetMessages() will return messages sorted by the id of the warning. Removes warnings.cpp from kernel.
This commit is contained in:
14
src/kernel/warning.h
Normal file
14
src/kernel/warning.h
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) 2024-present The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef BITCOIN_KERNEL_WARNING_H
|
||||
#define BITCOIN_KERNEL_WARNING_H
|
||||
|
||||
namespace kernel {
|
||||
enum class Warning {
|
||||
UNKNOWN_NEW_RULES_ACTIVATED,
|
||||
LARGE_WORK_INVALID_CHAIN,
|
||||
};
|
||||
} // namespace kernel
|
||||
#endif // BITCOIN_KERNEL_WARNING_H
|
||||
Reference in New Issue
Block a user