diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2017-07-27 10:08:31 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2019-01-15 12:42:00 -0400 |
commit | 700c42b85d20e624bef4228eef062c93084efab5 (patch) | |
tree | 60f0213d9b6671995ae6e7d2015d57ffdda89f4b /src/optional.h | |
parent | eb2aecfb80662a91c649ea1455d9812ced05c323 (diff) |
Add height, depth, and hash methods to the Chain interface
And use them to remove uses of chainActive and mapBlockIndex in wallet code
This commit does not change behavior.
Co-authored-by: Ben Woosley <ben.woosley@gmail.com>
Diffstat (limited to 'src/optional.h')
-rw-r--r-- | src/optional.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/optional.h b/src/optional.h new file mode 100644 index 0000000000..1614c89718 --- /dev/null +++ b/src/optional.h @@ -0,0 +1,17 @@ +// Copyright (c) 2017 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_OPTIONAL_H +#define BITCOIN_OPTIONAL_H + +#include <boost/optional.hpp> + +//! Substitute for C++17 std::optional +template <typename T> +using Optional = boost::optional<T>; + +//! Substitute for C++17 std::nullopt +static auto& nullopt = boost::none; + +#endif // BITCOIN_OPTIONAL_H |