aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-chainstate.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2021-12-01 18:16:29 -0500
committerRussell Yanofsky <russ@yanofsky.org>2022-07-19 15:54:52 -0500
commitb3e7de7ee6efb186efc272855ff1af5d9254b971 (patch)
treefba09f8cb042e154a536c0f8fd577a7090465411 /src/bitcoin-chainstate.cpp
parent3b91d4b9947adbec74721f538e46c712db22587c (diff)
downloadbitcoin-b3e7de7ee6efb186efc272855ff1af5d9254b971.tar.xz
refactor: Reduce number of LoadChainstate return values
Diffstat (limited to 'src/bitcoin-chainstate.cpp')
-rw-r--r--src/bitcoin-chainstate.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp
index 2981fc6c2f..4656cb23e7 100644
--- a/src/bitcoin-chainstate.cpp
+++ b/src/bitcoin-chainstate.cpp
@@ -90,13 +90,13 @@ int main(int argc, char* argv[])
cache_sizes.coins = (450 << 20) - (2 << 20) - (2 << 22);
node::ChainstateLoadOptions options;
options.check_interrupt = [] { return false; };
- auto rv = node::LoadChainstate(chainman, cache_sizes, options);
- if (rv.has_value()) {
+ auto [status, error] = node::LoadChainstate(chainman, cache_sizes, options);
+ if (status != node::ChainstateLoadStatus::SUCCESS) {
std::cerr << "Failed to load Chain state from your datadir." << std::endl;
goto epilogue;
} else {
- auto maybe_verify_error = node::VerifyLoadedChainstate(chainman, options);
- if (maybe_verify_error.has_value()) {
+ std::tie(status, error) = node::VerifyLoadedChainstate(chainman, options);
+ if (status != node::ChainstateLoadStatus::SUCCESS) {
std::cerr << "Failed to verify loaded Chain state from your datadir." << std::endl;
goto epilogue;
}