From 2a4314e5c62881253f890c9ce0d47e109fe09992 Mon Sep 17 00:00:00 2001 From: ale Date: Fri, 5 Apr 2024 19:58:48 +0200 Subject: [PATCH] fix: solve data race by making nTimeBestReceived atomic --- src/wallet/wallet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 85ebfa6de612e5..57cb8676ecaaca 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -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 nTimeBestReceived = 0; // Used only to inform the wallet of when we last received a block /** * Used to keep track of spent outpoints, and