aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-12-16 12:02:27 +0100
committerMarcoFalke <falke.marco@gmail.com>2020-12-19 09:45:58 +0100
commitfa7e803f3e4df33117927aef6fef9bfaee4f410d (patch)
tree57ebb7c6c8bb816c70384457db158ecb494ef2ce
parentfadd4029dced574778ade228931a7706f92bc676 (diff)
downloadbitcoin-fa7e803f3e4df33117927aef6fef9bfaee4f410d.tar.xz
Remove unused MakeOptional
The only use was to work around a compiler warning in an ancient compiler, which we no longer support.
-rw-r--r--src/optional.h7
-rw-r--r--src/wallet/rpcwallet.cpp5
-rw-r--r--src/wallet/wallet.cpp3
3 files changed, 3 insertions, 12 deletions
diff --git a/src/optional.h b/src/optional.h
index a382cd7b77..252d56fd58 100644
--- a/src/optional.h
+++ b/src/optional.h
@@ -13,13 +13,6 @@
template <typename T>
using Optional = boost::optional<T>;
-//! Substitute for C++17 std::make_optional
-template <typename T>
-Optional<T> MakeOptional(bool condition, T&& value)
-{
- return boost::make_optional(condition, std::forward<T>(value));
-}
-
//! Substitute for C++17 std::nullopt
static auto& nullopt = boost::none;
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 94a73b67df..614ebd22f6 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -1573,8 +1573,7 @@ static RPCHelpMan listsinceblock()
LOCK(wallet.cs_wallet);
- // The way the 'height' is initialized is just a workaround for the gcc bug #47679 since version 4.6.0.
- Optional<int> height = MakeOptional(false, int()); // Height of the specified block or the common ancestor, if the block provided was in a deactivated chain.
+ Optional<int> height; // Height of the specified block or the common ancestor, if the block provided was in a deactivated chain.
Optional<int> altheight; // Height of the specified block, even if it's in a deactivated chain.
int target_confirms = 1;
isminefilter filter = ISMINE_SPENDABLE;
@@ -3597,7 +3596,7 @@ static RPCHelpMan rescanblockchain()
}
int start_height = 0;
- Optional<int> stop_height = MakeOptional(false, int());
+ Optional<int> stop_height;
uint256 start_block;
{
LOCK(pwallet->cs_wallet);
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 740e671595..e8a67ede2b 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4055,8 +4055,7 @@ std::shared_ptr<CWallet> CWallet::Create(interfaces::Chain& chain, const std::st
// No need to read and scan block if block was created before
// our wallet birthday (as adjusted for block time variability)
- // The way the 'time_first_key' is initialized is just a workaround for the gcc bug #47679 since version 4.6.0.
- Optional<int64_t> time_first_key = MakeOptional(false, int64_t());;
+ Optional<int64_t> time_first_key;
for (auto spk_man : walletInstance->GetAllScriptPubKeyMans()) {
int64_t time = spk_man->GetTimeFirstKey();
if (!time_first_key || time < *time_first_key) time_first_key = time;