Skip to content

Commit bd9c181

Browse files
committed
[rpc] Add initialblockdownload to getblockchaininfo
1 parent 57ee739 commit bd9c181

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/rpc/blockchain.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request)
11351135
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n"
11361136
" \"mediantime\": xxxxxx, (numeric) median time for the current best block\n"
11371137
" \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n"
1138+
" \"initialblockdownload\": xxxx, (bool) (debug information) estimate of whether this node is in Initial Block Download mode.\n"
11381139
" \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n"
11391140
" \"size_on_disk\": xxxxxx, (numeric) the estimated size of the block and undo files on disk\n"
11401141
" \"pruned\": xx, (boolean) if the blocks are subject to pruning\n"
@@ -1183,6 +1184,7 @@ UniValue getblockchaininfo(const JSONRPCRequest& request)
11831184
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
11841185
obj.push_back(Pair("mediantime", (int64_t)chainActive.Tip()->GetMedianTimePast()));
11851186
obj.push_back(Pair("verificationprogress", GuessVerificationProgress(Params().TxData(), chainActive.Tip())));
1187+
obj.push_back(Pair("initialblockdownload", IsInitialBlockDownload()));
11861188
obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex()));
11871189
obj.push_back(Pair("size_on_disk", CalculateCurrentUsage()));
11881190
obj.push_back(Pair("pruned", fPruneMode));

test/functional/blockchain.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""Test RPCs related to blockchainstate.
66
77
Test the following RPCs:
8+
- getblockchaininfo
89
- gettxoutsetinfo
910
- getdifficulty
1011
- getbestblockhash
@@ -58,6 +59,7 @@ def _test_getblockchaininfo(self):
5859
'chainwork',
5960
'difficulty',
6061
'headers',
62+
'initialblockdownload',
6163
'mediantime',
6264
'pruned',
6365
'size_on_disk',

0 commit comments

Comments
 (0)