Browse Source

Add warnings field to getblockchaininfo

0.16
Andrew Chow 7 years ago
parent
commit
f77f0e4825
  1. 2
      src/rpc/blockchain.cpp
  2. 1
      test/functional/blockchain.py

2
src/rpc/blockchain.cpp

@ -1162,6 +1162,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request) @@ -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) @@ -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;
}

1
test/functional/blockchain.py

@ -60,6 +60,7 @@ class BlockchainTest(BitcoinTestFramework): @@ -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

Loading…
Cancel
Save