// Copyright (c) 2022 The Dash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CONTEXT_H #define BITCOIN_CONTEXT_H #include #include class ChainstateManager; class CTxMemPool; class CBlockPolicyEstimator; struct LLMQContext; struct NodeContext; struct WalletContext; using CoreContext = std::variant, std::reference_wrapper, std::reference_wrapper, std::reference_wrapper, std::reference_wrapper, std::reference_wrapper>; template T* GetContext(const CoreContext& ctx) noexcept { return std::holds_alternative>(ctx) ? &std::get>(ctx).get() : nullptr; } #endif // BITCOIN_CONTEXT_VARIANT_H