From a658d9269f09b03ade72596558ccb14cb745bdfc Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Apr 2018 21:08:20 +0300 Subject: [PATCH] Test --- src/komodo_bitcoind.h | 6 ++++-- src/pow.cpp | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 05db31fa9..46a6349e3 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -856,7 +856,6 @@ int32_t komodo_is_special(uint8_t pubkeys[66][33],int32_t mids[66],uint32_t bloc komodo_chosennotary(¬aryid,height,pubkey33,blocktimes[0]); if ( height >= 82000 ) { - fprintf(stderr,"lag.%d ht.%d n.%d blocktimes[%u vs %u %u]\n",blocktime-blocktimes[1],height,notaryid,blocktime,blocktimes[0],blocktimes[1]); if ( notaryid >= 0 ) { for (i=1; i<66; i++) @@ -872,8 +871,11 @@ int32_t komodo_is_special(uint8_t pubkeys[66][33],int32_t mids[66],uint32_t bloc } else break; } } - if ( blocktime < blocktimes[1]+57 ) + if ( blocktime != 0 && blocktimes[1] != 0 && blocktime < blocktimes[1]+57 ) { + fprintf(stderr,"lag.%d ht.%d n.%d blocktimes[%u vs %u %u]\n",blocktime-blocktimes[1],height,notaryid,blocktime,blocktimes[0],blocktimes[1]); + if ( height > 780000 ) + return(-2); } else return(1); } else return(0); } diff --git a/src/pow.cpp b/src/pow.cpp index 9bdd90cb1..01b4b6851 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -178,7 +178,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash,unsigned int } if ( (flag != 0 || special2 > 0) && special2 != -2 ) { - fprintf(stderr,"EASY MINING ht.%d\n",height); + //fprintf(stderr,"EASY MINING ht.%d\n",height); bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow); } } @@ -213,12 +213,12 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash,unsigned int return false; } } - for (i=31; i>=0; i--) + /*for (i=31; i>=0; i--) fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); fprintf(stderr," hash vs "); for (i=31; i>=0; i--) fprintf(stderr,"%02x",((uint8_t *)&bnTarget)[i]); - fprintf(stderr," height.%d notaryid.%d PoW valid\n",height,notaryid); + fprintf(stderr," height.%d notaryid.%d PoW valid\n",height,notaryid);*/ return true; }