PPCoin: Force asking for orphan block's parent block
authorRichard Smith <iceeatscream@gmail.com>
Wed, 20 Jun 2012 21:22:42 +0000 (22:22 +0100)
committerRichard Smith <iceeatscream@gmail.com>
Wed, 20 Jun 2012 21:22:42 +0000 (22:22 +0100)
        Fix an issue where a block previously failing duplicate
        proof-of-stake check was not asked for again

src/main.cpp

index 127ca29..4e27d4b 100644 (file)
@@ -1674,7 +1674,13 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock)
 
         // Ask this guy to fill in what we're missing
         if (pfrom)
+        {
             pfrom->PushGetBlocks(pindexBest, GetOrphanRoot(pblock2));
+            // ppcoin: getblocks may not obtain the parent block rejected earlier
+            // by duplicate-stake check so we must ask for it again directly
+            if (!mapOrphanBlocks.count(pblock->hashPrevBlock))
+                pfrom->AskFor(CInv(MSG_BLOCK, pblock->hashPrevBlock));
+        }
         return true;
     }