diff options
author | Jim Posen <jimpo@coinbase.com> | 2017-12-08 11:20:10 -0800 |
---|---|---|
committer | Jim Posen <jimpo@coinbase.com> | 2018-04-25 11:25:11 -0700 |
commit | f90c3a62f506d1bc0fe26972b312f07152c79b2e (patch) | |
tree | a5a6e11dd46e84f703a21a3288036a22b1e73ce4 /src/index/txindex.h | |
parent | 70d510d93c08a168407f55c932ab09c644dea3b8 (diff) |
[index] TxIndex method to wait until caught up.
In order to preserve getrawtransaction RPC behavior, there needs to be
a way for a thread to ensure the transaction index is in sync with the
current state of the blockchain.
Diffstat (limited to 'src/index/txindex.h')
-rw-r--r-- | src/index/txindex.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/index/txindex.h b/src/index/txindex.h index 633aee46ce..e1f1b17676 100644 --- a/src/index/txindex.h +++ b/src/index/txindex.h @@ -63,6 +63,12 @@ public: /// Destructor interrupts sync thread if running and blocks until it exits. ~TxIndex(); + /// Blocks the current thread until the transaction index is caught up to + /// the current state of the block chain. This only blocks if the index has gotten in sync once + /// and only needs to process blocks in the ValidationInterface queue. If the index is catching + /// up from far behind, this method does not block and immediately returns false. + bool BlockUntilSyncedToCurrentChain(); + /// Look up the on-disk location of a transaction by hash. bool FindTx(const uint256& txid, CDiskTxPos& pos) const; |