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.
This commit is contained in:
stickies-v
2024-04-10 12:16:21 +02:00
parent 842f7fdf78
commit 42fb5311b1
10 changed files with 71 additions and 37 deletions

View File

@@ -0,0 +1,8 @@
RPC
---
- the `warnings` field in `getblockchaininfo`, `getmininginfo` and
`getnetworkinfo` now returns all the active node warnings as an array
of strings, instead of just a single warning. The current behaviour
can temporarily be restored by running bitcoind with configuration
option `-deprecatedrpc=warnings`.