Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14864990
D11604.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D11604.id.diff
View Options
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp
--- a/src/rpc/misc.cpp
+++ b/src/rpc/misc.cpp
@@ -8,6 +8,7 @@
#include <config.h>
#include <httpserver.h>
#include <index/blockfilterindex.h>
+#include <index/coinstatsindex.h>
#include <index/txindex.h>
#include <interfaces/chain.h>
#include <key_io.h>
@@ -875,6 +876,11 @@
SummaryToJSON(g_txindex->GetSummary(), index_name));
}
+ if (g_coin_stats_index) {
+ result.pushKVs(SummaryToJSON(g_coin_stats_index->GetSummary(),
+ index_name));
+ }
+
ForEachBlockFilterIndex([&result, &index_name](
const BlockFilterIndex &index) {
result.pushKVs(SummaryToJSON(index.GetSummary(), index_name));
diff --git a/test/functional/rpc_misc.py b/test/functional/rpc_misc.py
--- a/test/functional/rpc_misc.py
+++ b/test/functional/rpc_misc.py
@@ -68,26 +68,24 @@
assert_equal(node.getindexinfo(), {})
# Restart the node with indices and wait for them to sync
- self.restart_node(0, ["-txindex", "-blockfilterindex"])
+ self.restart_node(
+ 0, ["-txindex", "-blockfilterindex", "-coinstatsindex"])
self.wait_until(
lambda: all(i["synced"] for i in node.getindexinfo().values()))
# Returns a list of all running indices by default
+ values = {"synced": True, "best_block_height": 200}
assert_equal(
node.getindexinfo(),
{
- "txindex": {"synced": True, "best_block_height": 200},
- "basic block filter index": {"synced": True, "best_block_height": 200}
+ "txindex": values,
+ "basic block filter index": values,
+ "coinstatsindex": values,
}
)
-
# Specifying an index by name returns only the status of that index
- assert_equal(
- node.getindexinfo("txindex"),
- {
- "txindex": {"synced": True, "best_block_height": 200},
- }
- )
+ for i in {"txindex", "basic block filter index", "coinstatsindex"}:
+ assert_equal(node.getindexinfo(i), {i: values})
# Specifying an unknown index name returns an empty result
assert_equal(node.getindexinfo("foo"), {})
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 21, 00:06 (56 m, 10 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5862710
Default Alt Text
D11604.id.diff (2 KB)
Attached To
D11604: rpc: Add Coinstats index to getindexinfo
Event Timeline
Log In to Comment