Skip to content

Commit

Permalink
Merge pull request #867 from Bushstar/move-redundant-lock
Browse files Browse the repository at this point in the history
Move redundant lock to blockOnchainActive
  • Loading branch information
qtum-neil authored Oct 13, 2020
2 parents c2d59a3 + a20ab93 commit 34fd05c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 0 additions & 3 deletions src/rpc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,6 @@ UniValue getblockhashes(const JSONRPCRequest& request)

std::vector<std::pair<uint256, unsigned int> > blockHashes;

if (fActiveOnly)
LOCK(cs_main);

if (!GetTimestampIndex(high, low, fActiveOnly, blockHashes)) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available for block hashes");
}
Expand Down
1 change: 1 addition & 0 deletions src/txdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ bool CBlockTreeDB::UpdateSpentIndex(const std::vector<std::pair<CSpentIndexKey,
}

bool CBlockTreeDB::blockOnchainActive(const uint256 &hash) {
LOCK(cs_main);
CBlockIndex* pblockindex = ::BlockIndex()[hash];

if (!::ChainActive().Contains(pblockindex)) {
Expand Down

0 comments on commit 34fd05c

Please sign in to comment.