From b3e7de7ee6efb186efc272855ff1af5d9254b971 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Wed, 1 Dec 2021 18:16:29 -0500 Subject: refactor: Reduce number of LoadChainstate return values --- src/bitcoin-chainstate.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/bitcoin-chainstate.cpp') 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; } -- cgit v1.2.3