From f77f0e4825e17fdda5984ce556a1102e32e7af72 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Mon, 17 Jul 2017 15:43:12 -0700 Subject: [PATCH] Add warnings field to getblockchaininfo --- src/rpc/blockchain.cpp | 2 ++ test/functional/blockchain.py | 1 + 2 files changed, 3 insertions(+) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 46f4f16321b..099e4825d4f 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1162,6 +1162,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request) " }\n" " }\n" " }\n" + " \"warnings\" : \"...\", (string) any network and blockchain errors.\n" "}\n" "\nExamples:\n" + HelpExampleCli("getblockchaininfo", "") @@ -1201,6 +1202,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request) obj.push_back(Pair("pruneheight", block->nHeight)); } + obj.push_back(Pair("warnings", GetWarnings("statusbar"))); return obj; } diff --git a/test/functional/blockchain.py b/test/functional/blockchain.py index 63c56d0e9b5..c5967aa10b3 100755 --- a/test/functional/blockchain.py +++ b/test/functional/blockchain.py @@ -60,6 +60,7 @@ class BlockchainTest(BitcoinTestFramework): 'pruned', 'softforks', 'verificationprogress', + 'warnings', ] res = self.nodes[0].getblockchaininfo() # result should have pruneheight and default keys if pruning is enabled