From 1dac305a7c41d942679841843d1558c9804dd591 Mon Sep 17 00:00:00 2001 From: Peter Shugalev Date: Sat, 20 Jul 2024 16:51:01 +0200 Subject: [PATCH] Changed visibility of critical section back to private --- src/llmq/quorums_instantsend.h | 2 +- src/wallet/test/createtransaction_tests.cpp | 3 +-- src/wallet/wallet.cpp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/llmq/quorums_instantsend.h b/src/llmq/quorums_instantsend.h index 398c99511f..c784d12763 100644 --- a/src/llmq/quorums_instantsend.h +++ b/src/llmq/quorums_instantsend.h @@ -109,10 +109,10 @@ class CInstantSendManager : public CRecoveredSigsListener std::unordered_set pendingRetryTxs; std::atomic_bool isNewInstantSendEnabled{false}; -public: CCriticalSection cs; CInstantSendDb db; +public: CInstantSendManager(CDBWrapper& _llmqDb); ~CInstantSendManager(); diff --git a/src/wallet/test/createtransaction_tests.cpp b/src/wallet/test/createtransaction_tests.cpp index 30bdf35ced..8017385a73 100644 --- a/src/wallet/test/createtransaction_tests.cpp +++ b/src/wallet/test/createtransaction_tests.cpp @@ -134,8 +134,7 @@ void AssertHasKey(CReserveKey& reservekey, const CWalletTx& wtx, uint32_t voutN) #define ASSERT_HAS_KEY(voutN) AssertHasKey(reservekey, wtx, voutN) #define ASSERT_SUCCESS() if (!strFailReason.empty()) BOOST_FAIL(strFailReason) #define ASSERT_FAILURE(reason) BOOST_ASSERT(strFailReason == reason) -#define ACQUIRE_LOCKS() LOCK2(cs_main, pwalletMain->cs_wallet);\ - LOCK(llmq::quorumInstantSendManager->cs); +#define ACQUIRE_LOCKS() LOCK2(cs_main, pwalletMain->cs_wallet) BOOST_FIXTURE_TEST_SUITE(createtransaction_tests, WalletTestingSetup) BOOST_AUTO_TEST_CASE(sends_money) { diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 3f142aaf8a..2270af3161 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -236,9 +236,8 @@ bool CTransparentTxout::IsLLMQInstantSendLocked() const { assert(wallet); AssertLockHeld(wallet->cs_wallet); - AssertLockHeld(llmq::quorumInstantSendManager->cs); - return llmq::quorumInstantSendManager->db.GetInstantSendLockByTxid(GetHash()) != nullptr; + return llmq::quorumInstantSendManager->IsLocked(GetHash()); } bool CTransparentTxout::IsCoinBase() const {