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 7, 2024
1 parent 4331c30 commit f9a6ebd
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 f9a6ebd

Please sign in to comment.