aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 7dd59fdea..56596ef18 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -653,8 +653,7 @@ bool CTxMemPool::remove(CTransaction &tx)
return true;
}
-void
-CTxMemPool::clear()
+void CTxMemPool::clear()
{
LOCK(cs);
mapTx.clear();
@@ -1920,17 +1919,20 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock)
}
- // If don't already have its previous block, shunt it off to holding area until we get it
+ // If we don't already have its previous block, shunt it off to holding area until we get it
if (!mapBlockIndex.count(pblock->hashPrevBlock))
{
printf("ProcessBlock: ORPHAN BLOCK, prev=%s\n", pblock->hashPrevBlock.ToString().substr(0,20).c_str());
- CBlock* pblock2 = new CBlock(*pblock);
- mapOrphanBlocks.insert(make_pair(hash, pblock2));
- mapOrphanBlocksByPrev.insert(make_pair(pblock2->hashPrevBlock, pblock2));
- // Ask this guy to fill in what we're missing
- if (pfrom)
+ // Accept orphans as long as there is a node to request its parents from
+ if (pfrom) {
+ CBlock* pblock2 = new CBlock(*pblock);
+ mapOrphanBlocks.insert(make_pair(hash, pblock2));
+ mapOrphanBlocksByPrev.insert(make_pair(pblock2->hashPrevBlock, pblock2));
+
+ // Ask this guy to fill in what we're missing
pfrom->PushGetBlocks(pindexBest, GetOrphanRoot(pblock2));
+ }
return true;
}