]> Git Repo - VerusCoin.git/commitdiff
Test
authorjl777 <[email protected]>
Fri, 13 Apr 2018 15:06:44 +0000 (18:06 +0300)
committerjl777 <[email protected]>
Fri, 13 Apr 2018 15:06:44 +0000 (18:06 +0300)
src/chain.h
src/komodo_bitcoind.h

index d3c46f9d64a473da159ea46bccae483ea7f1586a..3b8bbd9bde5ef6576ccb5981e579fd2334ab2d82 100644 (file)
@@ -177,7 +177,7 @@ public:
 
     //! (memory only) Sequential id assigned to distinguish order in which blocks are received.
     uint32_t nSequenceId;
-    int8_t notaryid; uint8_t pubkey33[33];
+    int8_t notaryid; uint8_t pubkey33[33],didinit;
     
     void SetNull()
     {
index 7cd05cccd8564c9ef1414e86d71d29bc33d67930..d7b50729092cb01f7158bc227fbafc87483b3009 100644 (file)
@@ -727,11 +727,11 @@ uint32_t komodo_heightstamp(int32_t height)
 void komodo_pindex_init(CBlockIndex *pindex,int32_t height)
 {
     int32_t i,num; uint8_t pubkeys[64][33]; CBlock block;
-    if ( pindex->notaryid >= 0 && (pindex->pubkey33[0] == 2 || pindex->pubkey33[0] == 3 || pindex->pubkey33[0] == 0xff) )
+    if ( pindex->notaryid >= 0 )
         return;
-    //printf("pindex.%d komodo_pindex_init notary.%d from height.%d\n",pindex->nHeight,pindex->notaryid,height);
+    printf("pindex.%d komodo_pindex_init notary.%d from height.%d\n",pindex->nHeight,pindex->notaryid,height);
     pindex->notaryid = -1;
-    if ( pindex->pubkey33[0] != 2 && pindex->pubkey33[0] != 3 && pindex->pubkey33[0] != 0xff )
+    if ( pindex->didinit == 0 )
     {
         if ( KOMODO_LOADINGBLOCKS == 0 )
             memset(pindex->pubkey33,0xff,33);
@@ -742,9 +742,10 @@ void komodo_pindex_init(CBlockIndex *pindex,int32_t height)
             for (i=0; i<33; i++)
                 fprintf(stderr,"%02x",pindex->pubkey33[i]);
             fprintf(stderr," set pubkey at height %d/%d\n",pindex->nHeight,height);
-        }
+            pindex->didinit = 1;
+        } else fprintf(stderr,"error loading block at %d/%d",pindex->nHeight,height);
     }
-    if ( (pindex->pubkey33[0] == 2 || pindex->pubkey33[0] == 3) && pindex->nHeight >= 0 && (num= komodo_notaries(pubkeys,(int32_t)pindex->nHeight,(uint32_t)pindex->nTime)) > 0 )
+    if ( pindex->didinit != 0 && pindex->nHeight >= 0 && (num= komodo_notaries(pubkeys,(int32_t)pindex->nHeight,(uint32_t)pindex->nTime)) > 0 )
     {
         for (i=0; i<num; i++)
         {
This page took 0.029927 seconds and 4 git commands to generate.