You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
{RPCResult::Type::NUM, "pruneheight", /*optional=*/true, "height of the last block pruned, plus one (only present if pruning is enabled)"},
1261
1260
{RPCResult::Type::BOOL, "automatic_pruning", /*optional=*/true, "whether automatic pruning is enabled (only present if pruning is enabled)"},
1262
1261
{RPCResult::Type::NUM, "prune_target_size", /*optional=*/true, "the target size used by pruning (only present if automatic pruning is enabled)"},
1263
-
{RPCResult::Type::STR, "warnings", "any network and blockchain warnings"},
1262
+
(IsDeprecatedRPCEnabled("warnings") ?
1263
+
RPCResult{RPCResult::Type::STR, "warnings", "any network and blockchain warnings (DEPRECATED)"} :
1264
+
RPCResult{RPCResult::Type::ARR, "warnings", "any network and blockchain warnings (run with `-deprecatedrpc=warnings` to return the latest warning as a single string)",
{RPCResult::Type::NUM, "networkhashps", "The network hashes per second"},
427
426
{RPCResult::Type::NUM, "pooledtx", "The size of the mempool"},
428
427
{RPCResult::Type::STR, "chain", "current network name (main, test, signet, regtest)"},
429
-
{RPCResult::Type::STR, "warnings", "any network and blockchain warnings"},
428
+
(IsDeprecatedRPCEnabled("warnings") ?
429
+
RPCResult{RPCResult::Type::STR, "warnings", "any network and blockchain warnings (DEPRECATED)"} :
430
+
RPCResult{RPCResult::Type::ARR, "warnings", "any network and blockchain warnings (run with `-deprecatedrpc=warnings` to return the latest warning as a single string)",
{RPCResult::Type::STR, "warnings", "any network and blockchain warnings"},
659
+
(IsDeprecatedRPCEnabled("warnings") ?
660
+
RPCResult{RPCResult::Type::STR, "warnings", "any network and blockchain warnings (DEPRECATED)"} :
661
+
RPCResult{RPCResult::Type::ARR, "warnings", "any network and blockchain warnings (run with `-deprecatedrpc=warnings` to return the latest warning as a single string)",
0 commit comments