diff options
author | Antoine Riard <ariard@student.42.fr> | 2019-07-16 15:20:01 -0400 |
---|---|---|
committer | Antoine Riard <ariard@student.42.fr> | 2020-04-30 14:37:21 -0400 |
commit | 0a76287387950bc9c5b634e95c5cd5fb1029f42d (patch) | |
tree | 40bc835faca023a5d008e9f315c5dc4918d11cb3 /src/interfaces/chain.cpp | |
parent | de13363a472ea30dff2f8f55c6ae572281115380 (diff) |
[wallet] Move getBlockHash from Chain::Lock interface to simple Chain
Diffstat (limited to 'src/interfaces/chain.cpp')
-rw-r--r-- | src/interfaces/chain.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp index ccdbf1f1d1..a4702558dc 100644 --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -55,13 +55,6 @@ bool FillBlock(const CBlockIndex* index, const FoundBlock& block, UniqueLock<Rec class LockImpl : public Chain::Lock, public UniqueLock<RecursiveMutex> { - uint256 getBlockHash(int height) override - { - LockAssertion lock(::cs_main); - CBlockIndex* block = ::ChainActive()[height]; - assert(block != nullptr); - return block->GetBlockHash(); - } bool haveBlockOnDisk(int height) override { LockAssertion lock(::cs_main); @@ -234,6 +227,13 @@ public: } return nullopt; } + uint256 getBlockHash(int height) override + { + LOCK(::cs_main); + CBlockIndex* block = ::ChainActive()[height]; + assert(block); + return block->GetBlockHash(); + } bool findBlock(const uint256& hash, const FoundBlock& block) override { WAIT_LOCK(cs_main, lock); |