Skip to content

Commit

Permalink
fix: solve data race by making nTimeBestReceived atomic
Browse files Browse the repository at this point in the history
  • Loading branch information
panleone committed Apr 5, 2024
1 parent d15beed commit 2a4314e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface

int64_t nNextResend;
int64_t nLastResend;
int64_t nTimeBestReceived = 0; // Used only to inform the wallet of when we last received a block
std::atomic<int64_t> nTimeBestReceived = 0; // Used only to inform the wallet of when we last received a block

/**
* Used to keep track of spent outpoints, and
Expand Down

0 comments on commit 2a4314e

Please sign in to comment.