aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/chain.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2019-05-16 21:43:22 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2019-05-16 21:43:22 +0200
commit9402ef0739fdcd8e989c07c0595095e9608b243c (patch)
tree5eb2b83a92bd349615dc204a0e15973d26b3a288 /src/interfaces/chain.cpp
parent593a8e8a2ce177c41a7809479c0086ae0fee4b4e (diff)
Remove temporary method assumeLocked(). Remove LockingStateImpl. Remove redundant cs_main locks.
Diffstat (limited to 'src/interfaces/chain.cpp')
-rw-r--r--src/interfaces/chain.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp
index 59623284d2..eaddcd9dd2 100644
--- a/src/interfaces/chain.cpp
+++ b/src/interfaces/chain.cpp
@@ -37,7 +37,7 @@
namespace interfaces {
namespace {
-class LockImpl : public Chain::Lock
+class LockImpl : public Chain::Lock, public UniqueLock<CCriticalSection>
{
Optional<int> getHeight() override
{
@@ -155,10 +155,7 @@ class LockImpl : public Chain::Lock
return AcceptToMemoryPool(::mempool, state, tx, nullptr /* missing inputs */, nullptr /* txn replaced */,
false /* bypass limits */, absurd_fee);
}
-};
-class LockingStateImpl : public LockImpl, public UniqueLock<CCriticalSection>
-{
using UniqueLock::UniqueLock;
};
@@ -249,13 +246,12 @@ class ChainImpl : public Chain
public:
std::unique_ptr<Chain::Lock> lock(bool try_lock) override
{
- auto result = MakeUnique<LockingStateImpl>(::cs_main, "cs_main", __FILE__, __LINE__, try_lock);
+ auto result = MakeUnique<LockImpl>(::cs_main, "cs_main", __FILE__, __LINE__, try_lock);
if (try_lock && result && !*result) return {};
// std::move necessary on some compilers due to conversion from
- // LockingStateImpl to Lock pointer
+ // LockImpl to Lock pointer
return std::move(result);
}
- std::unique_ptr<Chain::Lock> assumeLocked() override { return MakeUnique<LockImpl>(); }
bool findBlock(const uint256& hash, CBlock* block, int64_t* time, int64_t* time_max) override
{
CBlockIndex* index;