Index: main.cpp
===================================================================
--- main.cpp	(revision 114)
+++ main.cpp	(revision 115)
@@ -850,23 +850,21 @@
     return bnNew.GetCompact();
 }
 
-vector<int> vStartingHeight;
-void AddStartingHeight(int nStartingHeight)
+bool IsInitialBlockDownload()
 {
-    if (nStartingHeight != -1)
+    if (pindexBest == NULL)
+        return true;
+    static int64 nLastUpdate;
+    static CBlockIndex* pindexLastBest;
+    if (pindexBest != pindexLastBest)
     {
-        vStartingHeight.push_back(nStartingHeight);
-        sort(vStartingHeight.begin(), vStartingHeight.end());
+        pindexLastBest = pindexBest;
+        nLastUpdate = GetTime();
     }
+    return (GetTime() - nLastUpdate < 10 &&
+            pindexBest->nTime < GetTime() - 24 * 60 * 60);
 }
 
-bool IsInitialBlockDownload()
-{
-    int nMedian = 69000;
-    if (vStartingHeight.size() >= 5)
-        nMedian = vStartingHeight[vStartingHeight.size()/2];
-    return nBestHeight < nMedian-1000;
-}
 
 
 
@@ -874,7 +872,6 @@
 
 
 
-
 bool CTransaction::DisconnectInputs(CTxDB& txdb)
 {
     // Relinquish previous transactions' spent pointers
@@ -1923,7 +1920,6 @@
         }
 
         AddTimeData(pfrom->addr.ip, nTime);
-        AddStartingHeight(pfrom->nStartingHeight);
 
         // Change version
         if (pfrom->nVersion >= 209)
