]> Git Repo - VerusCoin.git/commitdiff
Test alternate block2height
authorjl777 <[email protected]>
Tue, 27 Mar 2018 16:03:55 +0000 (19:03 +0300)
committerjl777 <[email protected]>
Tue, 27 Mar 2018 16:03:55 +0000 (19:03 +0300)
src/komodo_bitcoind.h

index 0c905e7859960b837e83ef5769ba2022a0dfa82e..97d572e512c2ca014793691952596cccf0575a88 100644 (file)
@@ -612,7 +612,9 @@ int32_t komodo_is_notarytx(const CTransaction& tx)
 
 int32_t komodo_block2height(CBlock *block)
 {
-    int32_t i,n,height = 0; uint8_t *ptr;
+    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 ( block->vtx[0].vin.size() > 0 )
     {
 #ifdef KOMODO_ZCASH
@@ -635,6 +637,13 @@ int32_t komodo_block2height(CBlock *block)
         }
         //komodo_init(height);
     }
+    if ( height > 0 && height2 >= 0 )
+    {
+        static uint32_t match,mismatch;
+        if ( height != height2 || ((match+mismatch) % 1000) == 999 )
+            mismatch++, printf("block2height height.%d vs height2.%d, match.%d mismatch.%d\n",height,height2,match,mismatch);
+        else match++;
+    }
     return(height);
 }
 
@@ -866,7 +875,7 @@ int32_t komodo_MoM(int32_t *notarized_heightp,uint256 *MoMp,uint256 *kmdtxidp,in
 
 int32_t komodo_checkpoint(int32_t *notarized_heightp,int32_t nHeight,uint256 hash)
 {
-    int32_t notarized_height,MoMdepth; uint256 MoM,notarized_hash,notarized_desttxid; CBlockIndex *notary; CBlockIndex *pindex;
+    int32_t notarized_height,MoMdepth; uint256 MoM,notarized_hash,notarized_desttxid; CBlockIndex *notary,*pindex;
     if ( (pindex= chainActive.Tip()) == 0 )
         return(-1);
     notarized_height = komodo_notarizeddata(pindex->nHeight,&notarized_hash,&notarized_desttxid);
This page took 0.02393 seconds and 4 git commands to generate.