aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-02-01 23:07:19 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-02-01 23:07:19 +0200
commite9434ee03efdfc0a5a54cf46561e95fd93cba007 (patch)
treec4e20c0265adf6d75bd82f22c2ab8066a497e256 /src
parentf05c1ac444e0c893516535bfdf07c5c8cd9bce16 (diff)
Remove false positive GCC warning
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 4a38571dfc..405afb6d8d 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -13,6 +13,7 @@
#include <interfaces/wallet.h>
#include <key.h>
#include <key_io.h>
+#include <optional.h>
#include <policy/fees.h>
#include <policy/policy.h>
#include <primitives/block.h>
@@ -3910,7 +3911,8 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
// No need to read and scan block if block was created before
// our wallet birthday (as adjusted for block time variability)
- Optional<int64_t> time_first_key;
+ // 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());;
for (auto spk_man : walletInstance->GetAllScriptPubKeyMans()) {
int64_t time = spk_man->GetTimeFirstKey();
if (!time_first_key || time < *time_first_key) time_first_key = time;