Skip to content

Commit e9434ee

Browse files
committed
Remove false positive GCC warning
1 parent f05c1ac commit e9434ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wallet/wallet.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <interfaces/wallet.h>
1414
#include <key.h>
1515
#include <key_io.h>
16+
#include <optional.h>
1617
#include <policy/fees.h>
1718
#include <policy/policy.h>
1819
#include <primitives/block.h>
@@ -3910,7 +3911,8 @@ std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain,
39103911

39113912
// No need to read and scan block if block was created before
39123913
// our wallet birthday (as adjusted for block time variability)
3913-
Optional<int64_t> time_first_key;
3914+
// The way the 'time_first_key' is initialized is just a workaround for the gcc bug #47679 since version 4.6.0.
3915+
Optional<int64_t> time_first_key = MakeOptional(false, int64_t());;
39143916
for (auto spk_man : walletInstance->GetAllScriptPubKeyMans()) {
39153917
int64_t time = spk_man->GetTimeFirstKey();
39163918
if (!time_first_key || time < *time_first_key) time_first_key = time;

0 commit comments

Comments
 (0)