PPCoin: Fix initial block download stuck issue
authorSunny King <sunnyking9999@gmail.com>
Fri, 27 Jul 2012 13:44:49 +0000 (14:44 +0100)
committerSunny King <sunnyking9999@gmail.com>
Fri, 27 Jul 2012 13:44:49 +0000 (14:44 +0100)
src/main.cpp

index 70d6744..96b05a2 100644 (file)
@@ -2845,8 +2845,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
                         // Bypass PushInventory, this must send even if redundant,
                         // and we want it right after the last block so they don't
                         // wait for other stuff first.
+                        // ppcoin: send latest proof-of-work block to allow the
+                        // download node to accept as orphan (proof-of-stake 
+                        // block might be rejected by stake connection check)
                         vector<CInv> vInv;
-                        vInv.push_back(CInv(MSG_BLOCK, hashBestChain));
+                        vInv.push_back(CInv(MSG_BLOCK, GetLastBlockIndex(pindexBest, false)->GetBlockHash()));
                         pfrom->PushMessage("inv", vInv);
                         pfrom->hashContinue = 0;
                     }