From 9e6d49e91390b5963f6980673bc957cfd60da023 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Apr 2018 17:13:17 +0300 Subject: [PATCH] Test --- src/komodo_bitcoind.h | 4 ++-- src/pow.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 52d09cb20..bbc45807b 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -725,7 +725,7 @@ 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) ) + if ( pindex->notaryid >= 0 && (pindex->pubkey33[0] == 2 || pindex->pubkey33[0] == 3 || pindex->pubkey33[0] == 0xff) ) return; printf("pindex.%d komodo_pindex_init notary.%d from height.%d\n",pindex->nHeight,pindex->notaryid,height); pindex->notaryid = -1; @@ -815,7 +815,7 @@ int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,int32_t *non } else { - pindex_komodo_init(pindex,height-i); + komodo_pindex_init(pindex,height-i); //komodo_index2pubkey33(pubkey33,pindex,height-i); memcpy(pubkeys[i],pindex->pubkey33,33); if ( (mids[i]= komodo_minerid(height-i,pubkey33)) >= 0 ) diff --git a/src/pow.cpp b/src/pow.cpp index dac141c64..39a082bac 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -194,12 +194,17 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in for (i=31; i>=0; i--) printf("%02x",((uint8_t *)&bnTarget)[i]); printf(" ht.%d special.%d notaryid.%d ht.%d mod.%d error\n",height,special,notaryid,height,(height % 35)); + if ( pindex != 0 ) + { + pindex->notaryid = -1; + komodo_pindex_init(pindex,height); + } for (i=0; i<33; i++) printf("%02x",pubkey33[i]); printf(" <- pubkey\n"); for (i=0; i<66; i++) printf("%d ",mids[i]); - printf(" minerids from ht.%d\n",height); + printf(" minerids from ht.%d pindex.%p\n",height,pindex); //if ( KOMODO_LOADINGBLOCKS == 0 ) return false; }