Remove unused MakeOptional
The only use was to work around a compiler warning in an ancient compiler, which we no longer support.
This commit is contained in:
3 files changed
+3
-12
No files matched your search
@@ -13,13 +13,6 @@
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
using Optional = boost::optional<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
|
//! Substitute for C++17 std::nullopt
|
||||||
static auto& nullopt = boost::none;
|
static auto& nullopt = boost::none;
|
||||||
|
|
||||||
|
|||||||
@@ -1573,8 +1573,7 @@ static RPCHelpMan listsinceblock()
|
|||||||
|
|
||||||
LOCK(wallet.cs_wallet);
|
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; // Height of the specified block or the common ancestor, if the block provided was in a deactivated chain.
|
||||||
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> altheight; // Height of the specified block, even if it's in a deactivated chain.
|
Optional<int> altheight; // Height of the specified block, even if it's in a deactivated chain.
|
||||||
int target_confirms = 1;
|
int target_confirms = 1;
|
||||||
isminefilter filter = ISMINE_SPENDABLE;
|
isminefilter filter = ISMINE_SPENDABLE;
|
||||||
@@ -3597,7 +3596,7 @@ static RPCHelpMan rescanblockchain()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int start_height = 0;
|
int start_height = 0;
|
||||||
Optional<int> stop_height = MakeOptional(false, int());
|
Optional<int> stop_height;
|
||||||
uint256 start_block;
|
uint256 start_block;
|
||||||
{
|
{
|
||||||
LOCK(pwallet->cs_wallet);
|
LOCK(pwallet->cs_wallet);
|
||||||
|
|||||||
@@ -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
|
// No need to read and scan block if block was created before
|
||||||
// our wallet birthday (as adjusted for block time variability)
|
// 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;
|
||||||
Optional<int64_t> time_first_key = MakeOptional(false, int64_t());;
|
|
||||||
for (auto spk_man : walletInstance->GetAllScriptPubKeyMans()) {
|
for (auto spk_man : walletInstance->GetAllScriptPubKeyMans()) {
|
||||||
int64_t time = spk_man->GetTimeFirstKey();
|
int64_t time = spk_man->GetTimeFirstKey();
|
||||||
if (!time_first_key || time < *time_first_key) time_first_key = time;
|
if (!time_first_key || time < *time_first_key) time_first_key = time;
|
||||||
|
|||||||
Reference in new issue
Block a user