Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14864382
D11604.id33944.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.id33944.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 name in {"txindex", "basic block filter index", "coinstatsindex"}:
+ assert_equal(node.getindexinfo(name), {name: values})
# Specifying an unknown index name returns an empty result
assert_equal(node.getindexinfo("foo"), {})
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 20, 19:16 (3 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5864486
Default Alt Text
D11604.id33944.diff (2 KB)
Attached To
D11604: rpc: Add Coinstats index to getindexinfo
Event Timeline
Log In to Comment