mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
fix: fixes for orphange's locks and cs_main
This commit is contained in:
parent
002580c42d
commit
846ebab6e0
@ -1930,6 +1930,7 @@ void PeerManagerImpl::StartScheduledTasks(CScheduler& scheduler)
|
||||
*/
|
||||
void PeerManagerImpl::BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindex)
|
||||
{
|
||||
{
|
||||
LOCK2(::cs_main, g_cs_orphans);
|
||||
|
||||
auto orphanWorkSet = m_orphanage.GetCandidatesForBlock(*pblock);
|
||||
@ -1937,6 +1938,7 @@ void PeerManagerImpl::BlockConnected(const std::shared_ptr<const CBlock>& pblock
|
||||
LogPrint(BCLog::MEMPOOL, "Trying to process %d orphans\n", orphanWorkSet.size());
|
||||
ProcessOrphanTx(orphanWorkSet);
|
||||
}
|
||||
}
|
||||
|
||||
m_orphanage.EraseForBlock(*pblock);
|
||||
m_last_tip_update = GetTime<std::chrono::seconds>();
|
||||
|
@ -197,7 +197,7 @@ std::set<uint256> TxOrphanage::GetCandidatesForBlock(const CBlock& block)
|
||||
|
||||
void TxOrphanage::EraseForBlock(const CBlock& block)
|
||||
{
|
||||
AssertLockHeld(g_cs_orphans);
|
||||
LOCK(g_cs_orphans);
|
||||
|
||||
std::vector<uint256> vOrphanErase;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user