Skip to content

Commit

Permalink
Add warnings field to getblockchaininfo
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 authored and random-zebra committed Jun 2, 2021
1 parent ffcd781 commit 1d966ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "hash.h"
#include "validationinterface.h"
#include "wallet/wallet.h"
#include "warnings.h"

#include <stdint.h>
#include <univalue.h>
Expand Down Expand Up @@ -1010,6 +1011,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request)
" \"info\": \"xxxx\", (string) additional information about upgrade\n"
" }, ...\n"
"}\n"
" \"warnings\" : \"...\", (string) any network and blockchain errors.\n"

"\nExamples:\n" +
HelpExampleCli("getblockchaininfo", "") + HelpExampleRpc("getblockchaininfo", ""));
Expand Down Expand Up @@ -1039,7 +1041,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request)
NetworkUpgradeDescPushBack(upgrades, consensusParams, Consensus::UpgradeIndex(i), nTipHeight);
}
obj.pushKV("upgrades", upgrades);

obj.pushKV("warnings", GetWarnings("statusbar"));
return obj;
}

Expand Down
6 changes: 5 additions & 1 deletion test/functional/rpc_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def set_test_params(self):
self.num_nodes = 1

def run_test(self):
#self._test_getblockchaininfo()
self._test_getblockchaininfo()
self._test_gettxoutsetinfo()
self._test_getblockheader()
#self._test_getdifficulty()
Expand All @@ -54,6 +54,10 @@ def _test_getblockchaininfo(self):
'chainwork',
'difficulty',
'headers',
'initial_block_downloading',
'shield_pool_value',
'softforks',
'upgrades',
'verificationprogress',
'warnings',
]
Expand Down

0 comments on commit 1d966ce

Please sign in to comment.