From 42fb5311b19582361409d65c6fddeadbee14bb97 Mon Sep 17 00:00:00 2001 From: stickies-v Date: Wed, 10 Apr 2024 12:16:21 +0200 Subject: 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. --- src/warnings.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/warnings.h') 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 #include +#include 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 warning); -/** Format a string that describes several potential problems detected by the core. - * @param[in] verbose bool - * - if true, get all warnings separated by
- * - 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 GetWarnings(); #endif // BITCOIN_WARNINGS_H -- cgit v1.2.3