From 899e372886b40f6449370377f3be5bd7bf4d9b59 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Feb 2017 20:18:53 +0200 Subject: [PATCH 1/6] 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 2/6] 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 3/6] 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 4/6] 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 5/6] 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 6/6] 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;