mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
refactor: remove some nested code blocks
This commit is contained in:
parent
c2ac444abf
commit
ee6dc2d6ab
@ -334,10 +334,7 @@ bool CQuorumBlockProcessor::UndoBlock(const CBlock& block, gsl::not_null<const C
|
||||
m_evoDb.Erase(BuildInversedHeightKey(qc.llmqType, pindex->nHeight));
|
||||
}
|
||||
|
||||
{
|
||||
LOCK(minableCommitmentsCs);
|
||||
mapHasMinedCommitmentCache[qc.llmqType].erase(qc.quorumHash);
|
||||
}
|
||||
WITH_LOCK(minableCommitmentsCs, mapHasMinedCommitmentCache[qc.llmqType].erase(qc.quorumHash));
|
||||
|
||||
// if a reorg happened, we should allow to mine this commitment later
|
||||
AddMineableCommitment(qc);
|
||||
@ -452,11 +449,8 @@ uint256 CQuorumBlockProcessor::GetQuorumBlockHash(const Consensus::LLMQParams& l
|
||||
bool CQuorumBlockProcessor::HasMinedCommitment(Consensus::LLMQType llmqType, const uint256& quorumHash) const
|
||||
{
|
||||
bool fExists;
|
||||
{
|
||||
LOCK(minableCommitmentsCs);
|
||||
if (mapHasMinedCommitmentCache[llmqType].get(quorumHash, fExists)) {
|
||||
return fExists;
|
||||
}
|
||||
if (LOCK(minableCommitmentsCs); mapHasMinedCommitmentCache[llmqType].get(quorumHash, fExists)) {
|
||||
return fExists;
|
||||
}
|
||||
|
||||
fExists = m_evoDb.Exists(std::make_pair(DB_MINED_COMMITMENT, std::make_pair(llmqType, quorumHash)));
|
||||
|
Loading…
Reference in New Issue
Block a user