aboutsummaryrefslogtreecommitdiff
path: root/src/node/utxo_snapshot.h
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@pm.me>2022-04-20 17:40:01 -0400
committerJames O'Beirne <james.obeirne@pm.me>2022-09-13 13:30:14 -0400
commit252abd1e8bc5cdf4368ad55e827a873240535b28 (patch)
tree2a1c9aa9ab01a4bb5951140d52b5c5720fce5ec9 /src/node/utxo_snapshot.h
parentf9f1735f139b6a1f1c7fea50717ff90dc4ba2bce (diff)
downloadbitcoin-252abd1e8bc5cdf4368ad55e827a873240535b28.tar.xz
init: add utxo snapshot detection
Add functionality for activating a snapshot-based chainstate if one is detected on-disk. Also cautiously initialize chainstate cache usages so that we don't somehow blow past our cache allowances during initialization, then rebalance at the end of init. Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Diffstat (limited to 'src/node/utxo_snapshot.h')
-rw-r--r--src/node/utxo_snapshot.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node/utxo_snapshot.h b/src/node/utxo_snapshot.h
index b82a791092..c94521792f 100644
--- a/src/node/utxo_snapshot.h
+++ b/src/node/utxo_snapshot.h
@@ -58,8 +58,14 @@ bool WriteSnapshotBaseBlockhash(Chainstate& snapshot_chainstate)
std::optional<uint256> ReadSnapshotBaseBlockhash(fs::path chaindir)
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
+//! Suffix appended to the chainstate (leveldb) dir when created based upon
+//! a snapshot.
constexpr std::string_view SNAPSHOT_CHAINSTATE_SUFFIX = "_snapshot";
+
+//! Return a path to the snapshot-based chainstate dir, if one exists.
+std::optional<fs::path> FindSnapshotChainstateDir();
+
} // namespace node
#endif // BITCOIN_NODE_UTXO_SNAPSHOT_H