diff options
author | stickies-v <stickies-v@protonmail.com> | 2024-04-10 12:16:21 +0200 |
---|---|---|
committer | stickies-v <stickies-v@protonmail.com> | 2024-05-01 14:44:57 +0100 |
commit | 42fb5311b19582361409d65c6fddeadbee14bb97 (patch) | |
tree | 30d0e390d19a61f84583546126273298fdd50fc5 /src/warnings.h | |
parent | 842f7fdf786fcbbdf3df40522945813404f8a397 (diff) | |
download | bitcoin-42fb5311b19582361409d65c6fddeadbee14bb97.tar.xz |
rpc: return warnings as an array instead of just a single one
The RPC documentation for `getblockchaininfo`, `getmininginfo` and
`getnetworkinfo` states that "warnings" returns "any network and
blockchain warnings". In practice, only a single warning is returned.
Fix that by returning all warnings as an array.
As a side benefit, cleans up the GetWarnings() logic.
Diffstat (limited to 'src/warnings.h')
-rw-r--r-- | src/warnings.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/warnings.h b/src/warnings.h index 866bce6246..79dc2ffabf 100644 --- a/src/warnings.h +++ b/src/warnings.h @@ -8,6 +8,7 @@ #include <optional> #include <string> +#include <vector> struct bilingual_str; @@ -15,12 +16,7 @@ void SetMiscWarning(const bilingual_str& warning); void SetfLargeWorkInvalidChainFound(bool flag); /** Pass std::nullopt to disable the warning */ void SetMedianTimeOffsetWarning(std::optional<bilingual_str> warning); -/** Format a string that describes several potential problems detected by the core. - * @param[in] verbose bool - * - if true, get all warnings separated by <hr /> - * - if false, get the most important warning - * @returns the warning string - */ -bilingual_str GetWarnings(bool verbose); +/** Return potential problems detected by the node. */ +std::vector<bilingual_str> GetWarnings(); #endif // BITCOIN_WARNINGS_H |