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