From 1ca42fbfecf913aff1575bb2c28ffeb171f1e1cd Mon Sep 17 00:00:00 2001 From: Barry Deeney Date: Sat, 13 Jul 2019 19:00:28 +0800 Subject: [PATCH] Added a lock before we call GetTxStakeAmount() --- src/wallet/rpcwallet.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index eb63cd9bc..87785851f 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3215,6 +3215,9 @@ int64_t GetFirstStakeTime() // return int = Number of Wallet's elements analyzed int GetsStakeSubTotal(vStakePeriodRange_T& aRange) { + // Lock cs_main before we try to call GetTxStakeAmount + LOCK(cs_main); + int nElement = 0; int64_t nAmount = 0;