From 303fbd2061c9de797dd99a1a21b0a01fa60434f0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Feb 2017 18:03:45 +0200 Subject: [PATCH 01/15] test --- src/komodo_bitcoind.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index e0f5f6e1a..3ca9edce3 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -507,6 +507,7 @@ void komodo_disconnect(CBlockIndex *pindex,CBlock& block) } else printf("komodo_disconnect: ht.%d cant get komodo_state.(%s)\n",pindex->nHeight,ASSETCHAINS_SYMBOL); } + int32_t komodo_is_notarytx(const CTransaction& tx) { uint8_t *ptr,crypto777[33]; @@ -515,13 +516,16 @@ int32_t komodo_is_notarytx(const CTransaction& tx) #else ptr = (uint8_t *)&tx.vout[0].scriptPubKey[0]; #endif - decode_hex(crypto777,33,(char *)CRYPTO777_PUBSECPSTR); - if ( memcmp(ptr+1,crypto777,33) == 0 ) + if ( ptr != 0 ) { - //printf("found notarytx\n"); - return(1); + decode_hex(crypto777,33,(char *)CRYPTO777_PUBSECPSTR); + if ( memcmp(ptr+1,crypto777,33) == 0 ) + { + //printf("found notarytx\n"); + return(1); + } } - else return(0); + return(0); } int32_t komodo_block2height(CBlock *block) @@ -532,7 +536,7 @@ int32_t komodo_block2height(CBlock *block) #else ptr = (uint8_t *)&block->vtx[0].vin[0].scriptSig[0]; #endif - if ( block->vtx[0].vin[0].scriptSig.size() > 5 ) + if ( ptr != 0 && block->vtx[0].vin[0].scriptSig.size() > 5 ) { //for (i=0; i<6; i++) // printf("%02x",ptr[i]); From 0554de3c4b1d0a26e6af4d92cee0dd802175fa19 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Feb 2017 18:22:54 +0200 Subject: [PATCH 02/15] test --- src/komodo.h | 4 +-- src/komodo_bitcoind.h | 73 ++++++++++++++++++++++++------------------- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 5a379eb92..fe8b8871d 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -545,7 +545,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) for (j=0; j= sizeof(uint_32) && len <= sizeof(scriptbuf) ) { #ifdef KOMODO_ZCASH memcpy(scriptbuf,block.vtx[i].vout[j].scriptPubKey.data(),len); @@ -576,7 +576,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) for (j=1; j= sizeof(uint32_t) && len <= sizeof(scriptbuf) ) { #ifdef KOMODO_ZCASH memcpy(scriptbuf,block.vtx[i].vout[j].scriptPubKey.data(),len); diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 3ca9edce3..4cf9b4419 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -511,18 +511,21 @@ void komodo_disconnect(CBlockIndex *pindex,CBlock& block) int32_t komodo_is_notarytx(const CTransaction& tx) { uint8_t *ptr,crypto777[33]; -#ifdef KOMODO_ZCASH - ptr = (uint8_t *)tx.vout[0].scriptPubKey.data(); -#else - ptr = (uint8_t *)&tx.vout[0].scriptPubKey[0]; -#endif - if ( ptr != 0 ) + if ( tx.vout.size() > 0 ) { - decode_hex(crypto777,33,(char *)CRYPTO777_PUBSECPSTR); - if ( memcmp(ptr+1,crypto777,33) == 0 ) +#ifdef KOMODO_ZCASH + ptr = (uint8_t *)tx.vout[0].scriptPubKey.data(); +#else + ptr = (uint8_t *)&tx.vout[0].scriptPubKey[0]; +#endif + if ( ptr != 0 ) { - //printf("found notarytx\n"); - return(1); + decode_hex(crypto777,33,(char *)CRYPTO777_PUBSECPSTR); + if ( memcmp(ptr+1,crypto777,33) == 0 ) + { + //printf("found notarytx\n"); + return(1); + } } } return(0); @@ -531,41 +534,47 @@ int32_t komodo_is_notarytx(const CTransaction& tx) int32_t komodo_block2height(CBlock *block) { int32_t i,n,height = 0; uint8_t *ptr; -#ifdef KOMODO_ZCASH - ptr = (uint8_t *)block->vtx[0].vin[0].scriptSig.data(); -#else - ptr = (uint8_t *)&block->vtx[0].vin[0].scriptSig[0]; -#endif - if ( ptr != 0 && block->vtx[0].vin[0].scriptSig.size() > 5 ) + if ( block->vtx[0].vin.size() > 0 ) { - //for (i=0; i<6; i++) - // printf("%02x",ptr[i]); - n = ptr[0]; - for (i=0; ivtx[0].vin[0].scriptSig.data(); +#else + ptr = (uint8_t *)&block->vtx[0].vin[0].scriptSig[0]; +#endif + if ( ptr != 0 && block->vtx[0].vin[0].scriptSig.size() > 5 ) { - //03bb81000101(bb 187) (81 48001) (00 12288256) <- coinbase.6 ht.12288256 - height += ((uint32_t)ptr[i+1] << (i*8)); - //printf("(%02x %x %d) ",ptr[i+1],((uint32_t)ptr[i+1] << (i*8)),height); + //for (i=0; i<6; i++) + // printf("%02x",ptr[i]); + n = ptr[0]; + for (i=0; ivtx[0].vin[0].scriptSig.size(),height); } - //printf(" <- coinbase.%d ht.%d\n",(int32_t)block->vtx[0].vin[0].scriptSig.size(),height); + //komodo_init(height); } - //komodo_init(height); return(height); } void komodo_block2pubkey33(uint8_t *pubkey33,CBlock& block) { int32_t n; + memset(pubkey33,0,33); + if ( block->vtx[0].vout.size() > 0 ) + { #ifdef KOMODO_ZCASH - uint8_t *ptr = (uint8_t *)block.vtx[0].vout[0].scriptPubKey.data(); + uint8_t *ptr = (uint8_t *)block.vtx[0].vout[0].scriptPubKey.data(); #else - uint8_t *ptr = (uint8_t *)&block.vtx[0].vout[0].scriptPubKey[0]; + uint8_t *ptr = (uint8_t *)&block.vtx[0].vout[0].scriptPubKey[0]; #endif - //komodo_init(0); - n = block.vtx[0].vout[0].scriptPubKey.size(); - if ( n == 35 ) - memcpy(pubkey33,ptr+1,33); - else memset(pubkey33,0,33); + //komodo_init(0); + n = block.vtx[0].vout[0].scriptPubKey.size(); + if ( n == 35 ) + memcpy(pubkey33,ptr+1,33); + } } int32_t komodo_blockload(CBlock& block,CBlockIndex *pindex) From 97561034f6e719fc3b545a8f394f82b6d3121f41 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Feb 2017 18:24:19 +0200 Subject: [PATCH 03/15] test --- src/komodo.h | 2 +- src/komodo_bitcoind.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index fe8b8871d..ecb6e0368 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -545,7 +545,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) for (j=0; j= sizeof(uint_32) && len <= sizeof(scriptbuf) ) + if ( len >= sizeof(uint32_t) && len <= sizeof(scriptbuf) ) { #ifdef KOMODO_ZCASH memcpy(scriptbuf,block.vtx[i].vout[j].scriptPubKey.data(),len); diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 4cf9b4419..f98101d17 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -563,7 +563,7 @@ void komodo_block2pubkey33(uint8_t *pubkey33,CBlock& block) { int32_t n; memset(pubkey33,0,33); - if ( block->vtx[0].vout.size() > 0 ) + if ( block.vtx[0].vout.size() > 0 ) { #ifdef KOMODO_ZCASH uint8_t *ptr = (uint8_t *)block.vtx[0].vout[0].scriptPubKey.data(); From 8f704e3fcf40abf3d5a331b95c6a5304e83803ac Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 7 Feb 2017 22:22:51 +0200 Subject: [PATCH 04/15] fix getinfo bad notaryid --- src/rpcmisc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 0681265af..841a5fb4f 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -126,7 +126,7 @@ Value getinfo(const Array& params, bool fHelp) obj.push_back(Pair("errors", GetWarnings("statusbar"))); { char pubkeystr[65]; int32_t notaryid; - notaryid = komodo_whoami(pubkeystr,longestchain); + notaryid = komodo_whoami(pubkeystr,(int32_t)chainActive.Tip()->nHeight); obj.push_back(Pair("notaryid", notaryid)); obj.push_back(Pair("pubkey", pubkeystr)); if ( KOMODO_LASTMINED != 0 ) From de7d3a140a1fea880a49afb103774d38438f6783 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Feb 2017 09:20:09 +0200 Subject: [PATCH 05/15] test --- src/komodo_pax.h | 2 +- src/pow.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_pax.h b/src/komodo_pax.h index a8acba308..80f2a75b6 100644 --- a/src/komodo_pax.h +++ b/src/komodo_pax.h @@ -528,7 +528,7 @@ uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uin int32_t i,nonz=0; int64_t diff; uint64_t price,seed,sum = 0; if ( ASSETCHAINS_SYMBOL[0] == 0 && chainActive.Tip() != 0 && height > chainActive.Tip()->nHeight ) { - if ( height != 1381319936 ) + if ( height < 1381319936 ) printf("height.%d vs tip.%d\n",height,chainActive.Tip()->nHeight); return(0); } diff --git a/src/pow.cpp b/src/pow.cpp index eb813087f..3cf53f9d7 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -167,7 +167,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in // Check proof of work matches claimed amount if ( UintToArith256(hash) > bnTarget ) { - if ( KOMODO_LOADINGBLOCKS == 0 && height > 182507 && KOMODO_REWIND == 0 )//&& komodo_chainactive(height) != 0 && nonzpkeys > 0 + if ( KOMODO_LOADINGBLOCKS == 0 && height > 186269 && KOMODO_REWIND == 0 )//182507&& komodo_chainactive(height) != 0 && nonzpkeys > 0 { int32_t i; for (i=31; i>=0; i--) From e4b3ad624a077378798d2c5aa5cc2ff89a030790 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Feb 2017 09:54:00 +0200 Subject: [PATCH 06/15] test --- src/main.cpp | 6 ++++++ src/pow.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 679524628..c834b24cc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1435,7 +1435,13 @@ bool ReadBlockFromDisk(int32_t height,CBlock& block, const CDiskBlockPos& pos) // Check the header komodo_block2pubkey33(pubkey33,block); if (!(CheckEquihashSolution(&block, Params()) && CheckProofOfWork(height,pubkey33,block.GetHash(), block.nBits, Params().GetConsensus()))) + { + for (i=0; i<33; i++) + printf("%02x",pubkey33[i]); + fprintf(stderr," warning unexpected diff at ht.%d\n",height); + return error("ReadBlockFromDisk: Errors in block header at %s", pos.ToString()); + } return true; } diff --git a/src/pow.cpp b/src/pow.cpp index 3cf53f9d7..c48a59919 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -167,7 +167,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in // Check proof of work matches claimed amount if ( UintToArith256(hash) > bnTarget ) { - if ( KOMODO_LOADINGBLOCKS == 0 && height > 186269 && KOMODO_REWIND == 0 )//182507&& komodo_chainactive(height) != 0 && nonzpkeys > 0 + if ( KOMODO_LOADINGBLOCKS == 0 && height > 188000 && KOMODO_REWIND == 0 )//186269, 182507&& komodo_chainactive(height) != 0 && nonzpkeys > 0 { int32_t i; for (i=31; i>=0; i--) From 9f1ae77daf455ae0de419f6f1d3954128ce2cf46 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 8 Feb 2017 10:20:30 +0200 Subject: [PATCH 07/15] test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index c834b24cc..25d74eb1a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1436,7 +1436,7 @@ bool ReadBlockFromDisk(int32_t height,CBlock& block, const CDiskBlockPos& pos) komodo_block2pubkey33(pubkey33,block); if (!(CheckEquihashSolution(&block, Params()) && CheckProofOfWork(height,pubkey33,block.GetHash(), block.nBits, Params().GetConsensus()))) { - for (i=0; i<33; i++) + int32_t i; for (i=0; i<33; i++) printf("%02x",pubkey33[i]); fprintf(stderr," warning unexpected diff at ht.%d\n",height); From 899e372886b40f6449370377f3be5bd7bf4d9b59 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Feb 2017 20:18:53 +0200 Subject: [PATCH 08/15] Coinbasevalue --- src/rpcmining.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 5a3c0bbd1..b1be854e3 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -654,6 +654,7 @@ Value getblocktemplate(const Array& params, bool fHelp) // Correct this if GetBlockTemplate changes the order // entry.push_back(Pair("foundersreward", (int64_t)tx.vout[1].nValue)); //} + entry.push_back(Pair("coinbasevalue", 3*COIN)); entry.push_back(Pair("required", true)); txCoinbase = entry; } else From 9661ca22bb7f2888ad8b8928664181d25d43718b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Feb 2017 07:07:58 +0200 Subject: [PATCH 09/15] Test --- src/pow.cpp | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/pow.cpp b/src/pow.cpp index c48a59919..9ae787195 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -128,9 +128,6 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in if ( height == 0 ) height = komodo_currentheight() + 1; special = komodo_chosennotary(¬aryid,height,pubkey33); - //for (i=0; i<33; i++) - // printf("%02x",pubkey33[i]); - //printf(" <- ht.%d\n",height); flag = komodo_eligiblenotary(pubkeys,mids,&nonzpkeys,height); if ( height > 34000 ) // 0 -> non-special notary { @@ -142,14 +139,6 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in if ( nonz == 0 ) return(true); // will come back via different path with pubkey set special2 = komodo_is_special(height,pubkey33); - /*if ( notaryid >= 0 && ((height >= 64000 && height <= 90065) || (height % KOMODO_ELECTION_GAP) > 64) ) - { - if ( (height >= 64000 && height <= 90065) || (height % KOMODO_ELECTION_GAP) == 0 || (height < 80000 && (special != 0 || special2 > 0)) || (height >= 80000 && special2 > 0) ) - { - bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow); - flag = 1; - } - }*/ if ( notaryid >= 0 ) { if ( height > 10000 && height < 80000 && (special != 0 || special2 > 0) ) @@ -182,15 +171,20 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in for (i=0; i<66; i++) printf("%d ",mids[i]); printf(" minerids from ht.%d\n",height); + if ( notaryid == -1 ) + { + sleep(3); + komodo_chosennotary(¬aryid,height,pubkey33); + if ( notaryid >= 0 ) + { + flag = komodo_eligiblenotary(pubkeys,mids,&nonzpkeys,height); + printf("found notaryid.%d flag.%d\n",notaryid,flag); + return(true); + } + } return error("CheckProofOfWork(): hash doesn't match nBits"); } } - if ( 0 && height > 180000 && nonzpkeys > 0 && strcmp((char *)NOTARY_PUBKEY.c_str(),"03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828") == 0 ) - { - for (i=0; i<66; i++) - fprintf(stderr,"%d ",mids[i]); - fprintf(stderr," minerids from ht.%d\n",height); - } return true; } From edcf9a39c340644642bd067ae5ccba96fb6017f3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Feb 2017 08:14:49 +0200 Subject: [PATCH 10/15] Test --- src/komodo_bitcoind.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index f98101d17..ae0cde54d 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -685,7 +685,8 @@ int32_t komodo_minerids(uint8_t *minerids,int32_t height,int32_t width) int32_t komodo_is_special(int32_t height,uint8_t pubkey33[33]) { - int32_t i,notaryid,minerid,limit; uint8_t _pubkey33[33]; + int32_t i,notaryid,minerid,limit,nid; uint8_t _pubkey33[33]; + komodo_chosennotary(¬aryid,height,_pubkey33); if ( height >= 34000 && notaryid >= 0 ) { if ( height < 79693 ) @@ -695,10 +696,10 @@ int32_t komodo_is_special(int32_t height,uint8_t pubkey33[33]) else limit = 66; for (i=1; i Date: Sun, 19 Feb 2017 08:19:22 +0200 Subject: [PATCH 11/15] Test --- src/komodo_bitcoind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index ae0cde54d..1368a1673 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -697,7 +697,7 @@ int32_t komodo_is_special(int32_t height,uint8_t pubkey33[33]) for (i=1; i Date: Sun, 19 Feb 2017 08:38:03 +0200 Subject: [PATCH 12/15] Scheduled upgrade at 225000 --- src/komodo_bitcoind.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 1368a1673..2a29b1dc9 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -685,8 +685,9 @@ int32_t komodo_minerids(uint8_t *minerids,int32_t height,int32_t width) int32_t komodo_is_special(int32_t height,uint8_t pubkey33[33]) { - int32_t i,notaryid,minerid,limit,nid; uint8_t _pubkey33[33]; - komodo_chosennotary(¬aryid,height,_pubkey33); + int32_t i,notaryid=0,minerid,limit,nid; uint8_t _pubkey33[33]; + if ( height >= 225000 ) + komodo_chosennotary(¬aryid,height,_pubkey33); if ( height >= 34000 && notaryid >= 0 ) { if ( height < 79693 ) @@ -699,8 +700,10 @@ int32_t komodo_is_special(int32_t height,uint8_t pubkey33[33]) komodo_chosennotary(&nid,height-i,_pubkey33); if ( nid == notaryid ) //komodo_minerid(height-i,_pubkey33) { - fprintf(stderr,"ht.%d notaryid.%d already mined -i.%d nid.%d\n",height,notaryid,i,nid); - return(-1); + if ( (0) && notaryid > 0 ) + fprintf(stderr,"ht.%d notaryid.%d already mined -i.%d nid.%d\n",height,notaryid,i,nid); + if ( height > 225000 ) + return(-1); } } //fprintf(stderr,"special notaryid.%d ht.%d limit.%d\n",notaryid,height,limit); From 96e6053c04dbff024167105f2c8ea2d4501fc836 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Feb 2017 08:54:09 +0200 Subject: [PATCH 13/15] 225000 scheduled update --- src/komodo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo.h b/src/komodo.h index ecb6e0368..43c192274 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -537,7 +537,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block) } else printf("cant get scriptPubKey for ht.%d txi.%d vin.%d\n",height,i,j); } numvalid = bitweight(signedmask); - if ( (((height < 90000 || (signedmask & 1) != 0) && numvalid >= KOMODO_MINRATIFY) || numvalid > (numnotaries/4)) ) + if ( (((height < 90000 || (signedmask & 1) != 0) && numvalid >= KOMODO_MINRATIFY) || numvalid > (numnotaries/5)) ) { printf("%s ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d <<<<<<<<<<< notarized\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts); notarized = 1; From 755c2b0044cf9f9df389ce2a005b7e66819c5a2e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Feb 2017 09:26:18 +0200 Subject: [PATCH 14/15] test --- src/komodo_bitcoind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 2a29b1dc9..de77d944a 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -700,7 +700,7 @@ int32_t komodo_is_special(int32_t height,uint8_t pubkey33[33]) komodo_chosennotary(&nid,height-i,_pubkey33); if ( nid == notaryid ) //komodo_minerid(height-i,_pubkey33) { - if ( (0) && notaryid > 0 ) + if ( (1) && notaryid > 0 ) fprintf(stderr,"ht.%d notaryid.%d already mined -i.%d nid.%d\n",height,notaryid,i,nid); if ( height > 225000 ) return(-1); From 86ad1cb1a010787cef5d90f3593915e3fa1d8cca Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Feb 2017 10:29:32 +0200 Subject: [PATCH 15/15] Scheduled update 225000 --- src/komodo_bitcoind.h | 2 +- src/pow.cpp | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index de77d944a..2a29b1dc9 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -700,7 +700,7 @@ int32_t komodo_is_special(int32_t height,uint8_t pubkey33[33]) komodo_chosennotary(&nid,height-i,_pubkey33); if ( nid == notaryid ) //komodo_minerid(height-i,_pubkey33) { - if ( (1) && notaryid > 0 ) + if ( (0) && notaryid > 0 ) fprintf(stderr,"ht.%d notaryid.%d already mined -i.%d nid.%d\n",height,notaryid,i,nid); if ( height > 225000 ) return(-1); diff --git a/src/pow.cpp b/src/pow.cpp index 9ae787195..75d14c9cc 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -171,18 +171,8 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in for (i=0; i<66; i++) printf("%d ",mids[i]); printf(" minerids from ht.%d\n",height); - if ( notaryid == -1 ) - { - sleep(3); - komodo_chosennotary(¬aryid,height,pubkey33); - if ( notaryid >= 0 ) - { - flag = komodo_eligiblenotary(pubkeys,mids,&nonzpkeys,height); - printf("found notaryid.%d flag.%d\n",notaryid,flag); - return(true); - } - } - return error("CheckProofOfWork(): hash doesn't match nBits"); + if ( notaryid >= 0 ) + return error("CheckProofOfWork(): hash doesn't match nBits"); } } return true;