aboutsummaryrefslogtreecommitdiff
path: root/src/index
diff options
context:
space:
mode:
authorJim Posen <jimpo@coinbase.com>2017-12-08 11:29:59 -0800
committerJim Posen <jimpo@coinbase.com>2018-04-25 11:25:12 -0700
commit8181db88f6e0ed96654951e18b1558cd8f78765b (patch)
tree45a4614e5baf4e0df61995519938b06b47e079ae /src/index
parentf90c3a62f506d1bc0fe26972b312f07152c79b2e (diff)
downloadbitcoin-8181db88f6e0ed96654951e18b1558cd8f78765b.tar.xz
[init] Initialize and start TxIndex in init code.
Diffstat (limited to 'src/index')
-rw-r--r--src/index/txindex.cpp2
-rw-r--r--src/index/txindex.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp
index 484526a6d9..7992d85338 100644
--- a/src/index/txindex.cpp
+++ b/src/index/txindex.cpp
@@ -14,6 +14,8 @@
constexpr int64_t SYNC_LOG_INTERVAL = 30; // seconds
constexpr int64_t SYNC_LOCATOR_WRITE_INTERVAL = 30; // seconds
+std::unique_ptr<TxIndex> g_txindex;
+
template<typename... Args>
static void FatalError(const char* fmt, const Args&... args)
{
diff --git a/src/index/txindex.h b/src/index/txindex.h
index e1f1b17676..41199f0b3f 100644
--- a/src/index/txindex.h
+++ b/src/index/txindex.h
@@ -82,4 +82,7 @@ public:
void Stop();
};
+/// The global transaction index, used in GetTransaction. May be null.
+extern std::unique_ptr<TxIndex> g_txindex;
+
#endif // BITCOIN_INDEX_TXINDEX_H