]> Git Repo - VerusCoin.git/blobdiff - src/komodo_bitcoind.h
Test
[VerusCoin.git] / src / komodo_bitcoind.h
index e23119eaaf9348343c87f3652a5388c90b399905..6f83579858f9481f78d310ef130d025a17d539ea 100644 (file)
@@ -612,9 +612,14 @@ int32_t komodo_is_notarytx(const CTransaction& tx)
 
 int32_t komodo_block2height(CBlock *block)
 {
+    static uint32_t match,mismatch;
     int32_t i,n,height2=-1,height = 0; uint8_t *ptr; CBlockIndex *pindex;
     if ( (pindex= mapBlockIndex[block->GetHash()]) != 0 )
+    {
         height2 = (int32_t)pindex->nHeight;
+        if ( height2 >= 0 )
+            return(height2);
+    }
     if ( block->vtx[0].vin.size() > 0 )
     {
 #ifdef KOMODO_ZCASH
@@ -637,16 +642,13 @@ int32_t komodo_block2height(CBlock *block)
         }
         //komodo_init(height);
     }
-    if ( height > 0 && height2 >= 0 )
+    if ( height != height2 )
     {
-        static uint32_t match,mismatch;
-        if ( height != height2 || ((match+mismatch) % 10) == 9 )
-        {
-            mismatch++, fprintf(stderr,"block2height height.%d vs height2.%d, match.%d mismatch.%d\n",height,height2,match,mismatch);
+        fprintf(stderr,"block2height height.%d vs height2.%d, match.%d mismatch.%d\n",height,height2,match,mismatch);
+        mismatch++;
+        if ( height2 >= 0 )
             height = height2;
-        }
-        else match++;
-    }
+    } else match++;
     return(height);
 }
 
This page took 0.024982 seconds and 4 git commands to generate.