aboutsummaryrefslogtreecommitdiff
path: root/src/test/validation_chainstate_tests.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-07-29 08:12:13 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-07-29 08:00:54 +0200
commitfaec851b6eb7e65e28cdcae50d6dc86fafa0f91c (patch)
treebcecc516c9238960a76d2035387be24b7d8a27ae /src/test/validation_chainstate_tests.cpp
parent2f71a1ea35667b3873197201531e7ae198ec5bf4 (diff)
test: Simplify cs_main locks
Diffstat (limited to 'src/test/validation_chainstate_tests.cpp')
-rw-r--r--src/test/validation_chainstate_tests.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/test/validation_chainstate_tests.cpp b/src/test/validation_chainstate_tests.cpp
index f531b393b8..2076a1096a 100644
--- a/src/test/validation_chainstate_tests.cpp
+++ b/src/test/validation_chainstate_tests.cpp
@@ -34,9 +34,7 @@ BOOST_AUTO_TEST_CASE(validation_chainstate_resize_caches)
return outp;
};
- ENTER_CRITICAL_SECTION(cs_main);
- CChainState& c1 = manager.InitializeChainstate();
- LEAVE_CRITICAL_SECTION(cs_main);
+ CChainState& c1 = *WITH_LOCK(cs_main, return &manager.InitializeChainstate());
c1.InitCoinsDB(
/* cache_size_bytes */ 1 << 23, /* in_memory */ true, /* should_wipe */ false);
WITH_LOCK(::cs_main, c1.InitCoinsCache(1 << 23));