From 5afce1bec742f37dd4c11184afb5325ab0aa89fc Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 20:13:44 +0200 Subject: [PATCH 01/20] test --- src/komodo_bitcoind.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 493292763..0dc5bcc96 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -637,16 +637,18 @@ int32_t komodo_eligiblenotary(int32_t *mids,int32_t *nonzpkeysp,int32_t height) { int32_t i,duplicate; CBlockIndex *pindex; uint8_t pubkey33[33]; memset(mids,-1,sizeof(*mids)*66); + pindex = komodo_chainactive(height); for (i=duplicate=0; i<66; i++) { - if ( (pindex= komodo_chainactive(height-i)) != 0 ) + if ( pindex != 0 ) { komodo_index2pubkey33(pubkey33,pindex,height-i); if ( (mids[i]= komodo_minerid(height-i,pubkey33)) >= 0 ) (*nonzpkeysp)++; if ( mids[0] >= 0 && i > 0 && mids[i] == mids[0] ) duplicate++; - } + pindex = pindex->pprev; + } else break; } if ( i == 66 && duplicate == 0 && *nonzpkeysp > 0 ) return(1); From 86ea3c770de0b391e86d14baeca986910867bcea Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 20:18:47 +0200 Subject: [PATCH 02/20] test --- src/komodo_bitcoind.h | 2 +- src/pow.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 0dc5bcc96..3eed9f2d7 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -643,7 +643,7 @@ int32_t komodo_eligiblenotary(int32_t *mids,int32_t *nonzpkeysp,int32_t height) if ( pindex != 0 ) { komodo_index2pubkey33(pubkey33,pindex,height-i); - if ( (mids[i]= komodo_minerid(height-i,pubkey33)) >= 0 ) + if ( (mids[i]= komodo_minerid(height-i,pubkey33) | (pindex->nHeight<<8)) >= 0 ) (*nonzpkeysp)++; if ( mids[0] >= 0 && i > 0 && mids[i] == mids[0] ) duplicate++; diff --git a/src/pow.cpp b/src/pow.cpp index ba5a745d4..bbc514c3f 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -188,7 +188,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in if ( 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,"%x ",mids[i]); fprintf(stderr," minerids from ht.%d\n",height); } return true; From 17c303ddf4f26900c70c4948d0168210d76dcbb0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 20:26:58 +0200 Subject: [PATCH 03/20] test --- src/komodo_bitcoind.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 3eed9f2d7..52de0c960 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -643,8 +643,11 @@ int32_t komodo_eligiblenotary(int32_t *mids,int32_t *nonzpkeysp,int32_t height) if ( pindex != 0 ) { komodo_index2pubkey33(pubkey33,pindex,height-i); - if ( (mids[i]= komodo_minerid(height-i,pubkey33) | (pindex->nHeight<<8)) >= 0 ) + if ( (mids[i]= komodo_minerid(height-i,pubkey33)) >= 0 ) + { + mids[i] = *(int32_t *)pubkey33; (*nonzpkeysp)++; + } if ( mids[0] >= 0 && i > 0 && mids[i] == mids[0] ) duplicate++; pindex = pindex->pprev; From 611acf2262b4d6606f9bbb8b06b775a3bbb4cba4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 20:27:38 +0200 Subject: [PATCH 04/20] test --- src/komodo_bitcoind.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 52de0c960..8714774cf 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -616,7 +616,7 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height); int8_t komodo_minerid(int32_t height,uint8_t *pubkey33) { int32_t num,i; CBlockIndex *pindex; uint8_t _pubkey33[33],pubkeys[64][33]; - if ( (pindex= chainActive[height]) != 0 ) + /*if ( (pindex= chainActive[height]) != 0 ) { if ( pubkey33 == 0 ) { @@ -629,7 +629,7 @@ int8_t komodo_minerid(int32_t height,uint8_t *pubkey33) if ( memcmp(pubkeys[i],pubkey33,33) == 0 ) return(i); } - } + }*/ return(komodo_electednotary(pubkey33,height)); } @@ -645,7 +645,7 @@ int32_t komodo_eligiblenotary(int32_t *mids,int32_t *nonzpkeysp,int32_t height) komodo_index2pubkey33(pubkey33,pindex,height-i); if ( (mids[i]= komodo_minerid(height-i,pubkey33)) >= 0 ) { - mids[i] = *(int32_t *)pubkey33; + //mids[i] = *(int32_t *)pubkey33; (*nonzpkeysp)++; } if ( mids[0] >= 0 && i > 0 && mids[i] == mids[0] ) From 8c654ec508ad364cb1290b6872ccdb46e766fdd8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 20:38:40 +0200 Subject: [PATCH 05/20] test --- src/komodo_bitcoind.h | 4 +++- src/miner.cpp | 12 +++++++++--- src/pow.cpp | 6 +++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 8714774cf..c119ac5b9 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -633,7 +633,7 @@ int8_t komodo_minerid(int32_t height,uint8_t *pubkey33) return(komodo_electednotary(pubkey33,height)); } -int32_t komodo_eligiblenotary(int32_t *mids,int32_t *nonzpkeysp,int32_t height) +int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,int32_t *nonzpkeysp,int32_t height) { int32_t i,duplicate; CBlockIndex *pindex; uint8_t pubkey33[33]; memset(mids,-1,sizeof(*mids)*66); @@ -643,6 +643,8 @@ int32_t komodo_eligiblenotary(int32_t *mids,int32_t *nonzpkeysp,int32_t height) if ( pindex != 0 ) { komodo_index2pubkey33(pubkey33,pindex,height-i); + for (j=0; j<33; j++) + pubkeys[i][j] = pubkey33[j]; if ( (mids[i]= komodo_minerid(height-i,pubkey33)) >= 0 ) { //mids[i] = *(int32_t *)pubkey33; diff --git a/src/miner.cpp b/src/miner.cpp index ab102aa96..cc55cad50 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -520,7 +520,7 @@ static bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& rese } int32_t komodo_baseid(char *origbase); -int32_t komodo_eligiblenotary(int32_t *mids,int32_t *nonzpkeysp,int32_t height); +int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,int32_t *nonzpkeysp,int32_t height); void static BitcoinMiner(CWallet *pwallet) { @@ -615,18 +615,24 @@ void static BitcoinMiner(CWallet *pwallet) // // Search // - int mids[66],nonzpkeys,j; uint32_t savebits; int64_t nStart = GetTime(); + uint8_t pubkeys[66][33]; int mids[66],nonzpkeys,i,j; uint32_t savebits; int64_t nStart = GetTime(); savebits = pblock->nBits; arith_uint256 hashTarget = arith_uint256().SetCompact(pblock->nBits); if ( ASSETCHAINS_SYMBOL[0] == 0 && notaryid >= 0 )//komodo_is_special(pindexPrev->nHeight+1,NOTARY_PUBKEY33) > 0 ) { if ( (Mining_height % KOMODO_ELECTION_GAP) > 64 || (Mining_height % KOMODO_ELECTION_GAP) == 0 ) { - komodo_eligiblenotary(mids,&nonzpkeys,pindexPrev->nHeight); + komodo_eligiblenotary(pubkeys,mids,&nonzpkeys,pindexPrev->nHeight); if ( nonzpkeys > 0 ) { if ( notaryid < 2 ) { + for (i=0; i<15; i++) + { + for (j=0; j<33; j++) + printf("%02x",pubkeys[i][j]); + printf(" p%d\n",i); + } for (j=0; j<65; j++) fprintf(stderr,"%d ",mids[j]); fprintf(stderr," <- prev minerids from ht.%d notary.%d\n",pindexPrev->nHeight,notaryid); diff --git a/src/pow.cpp b/src/pow.cpp index bbc514c3f..dcc1097c9 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -113,7 +113,7 @@ void komodo_index2pubkey33(uint8_t *pubkey33,CBlockIndex *pindex,int32_t height) extern int32_t KOMODO_CHOSEN_ONE; #define KOMODO_ELECTION_GAP 2000 -int32_t komodo_eligiblenotary(int32_t *mids,int32_t *nonzpkeysp,int32_t height); +int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,int32_t *nonzpkeysp,int32_t height); extern std::string NOTARY_PUBKEY; @@ -122,7 +122,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in { extern int32_t KOMODO_REWIND; bool fNegative,fOverflow; int32_t i,nonzpkeys=0,nonz=0,special=0,special2=0,notaryid=-1,duplicate,flag = 0, mids[66]; - arith_uint256 bnTarget; CBlockIndex *pindex; + arith_uint256 bnTarget; CBlockIndex *pindex; uint8_t pubkeys[66][33]; bnTarget.SetCompact(nBits, &fNegative, &fOverflow); if ( height == 0 ) @@ -131,7 +131,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in //for (i=0; i<33; i++) // printf("%02x",pubkey33[i]); //printf(" <- ht.%d\n",height); - flag = komodo_eligiblenotary(mids,&nonzpkeys,height); + flag = komodo_eligiblenotary(pubkeys,mids,&nonzpkeys,height); if ( height > 34000 ) // 0 -> non-special notary { for (i=0; i<33; i++) From dac1ef8881b0139a007750ad2db38c5aaa36f540 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 20:41:31 +0200 Subject: [PATCH 06/20] test --- src/komodo_bitcoind.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index c119ac5b9..6b309ce1b 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -616,7 +616,7 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height); int8_t komodo_minerid(int32_t height,uint8_t *pubkey33) { int32_t num,i; CBlockIndex *pindex; uint8_t _pubkey33[33],pubkeys[64][33]; - /*if ( (pindex= chainActive[height]) != 0 ) + if ( (pindex= chainActive[height]) != 0 ) { if ( pubkey33 == 0 ) { @@ -629,13 +629,13 @@ int8_t komodo_minerid(int32_t height,uint8_t *pubkey33) if ( memcmp(pubkeys[i],pubkey33,33) == 0 ) return(i); } - }*/ + } return(komodo_electednotary(pubkey33,height)); } int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,int32_t *nonzpkeysp,int32_t height) { - int32_t i,duplicate; CBlockIndex *pindex; uint8_t pubkey33[33]; + int32_t i,j,duplicate; CBlockIndex *pindex; uint8_t pubkey33[33]; memset(mids,-1,sizeof(*mids)*66); pindex = komodo_chainactive(height); for (i=duplicate=0; i<66; i++) From b27b0b2b1ffb5ad94eefbe9f35d543ededead6c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 21:05:37 +0200 Subject: [PATCH 07/20] test --- src/miner.cpp | 4 ++-- src/pow.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index cc55cad50..cab48a9d9 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -627,11 +627,11 @@ void static BitcoinMiner(CWallet *pwallet) { if ( notaryid < 2 ) { - for (i=0; i<15; i++) + for (i=0; i<66; i++) { for (j=0; j<33; j++) printf("%02x",pubkeys[i][j]); - printf(" p%d\n",i); + printf(" p%d -> %d\n",i,komodo_minerid(pindexPrev->nHeight-i,pubkeys[i])); } for (j=0; j<65; j++) fprintf(stderr,"%d ",mids[j]); diff --git a/src/pow.cpp b/src/pow.cpp index dcc1097c9..923639639 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -188,7 +188,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in if ( height > 180000 && nonzpkeys > 0 && strcmp((char *)NOTARY_PUBKEY.c_str(),"03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828") == 0 ) { for (i=0; i<66; i++) - fprintf(stderr,"%x ",mids[i]); + fprintf(stderr,"%d ",mids[i]); fprintf(stderr," minerids from ht.%d\n",height); } return true; From 6721741d13144e549a3e2cdc1789b96a15b8970f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 21:17:36 +0200 Subject: [PATCH 08/20] test --- src/komodo_notary.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 20559c954..423229e23 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -154,6 +154,13 @@ int32_t komodo_ratify_threshold(int32_t height,uint64_t signedmask) int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height) { int32_t i,htind,n; uint64_t mask = 0; struct knotary_entry *kp,*tmp; + if ( height >= 180000 ) + { + n = (int32_t)(sizeof(Notaries_elected)/sizeof(*Notaries_elected)); + for (i=0; i Date: Thu, 2 Feb 2017 21:18:35 +0200 Subject: [PATCH 09/20] test --- src/komodo_notary.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 423229e23..145114381 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -158,7 +158,7 @@ int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height) { n = (int32_t)(sizeof(Notaries_elected)/sizeof(*Notaries_elected)); for (i=0; i Date: Thu, 2 Feb 2017 21:21:47 +0200 Subject: [PATCH 10/20] test --- src/komodo_notary.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 145114381..e97e3e9c3 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -132,8 +132,10 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height) for (i=0; i elected %s\n",(char *)Notaries_elected[i][1]); return(i); - //printf("%s\n",(char *)Notaries_elected[i][1]); + } } return(-1); } From a8e94add843dede36ac8bf206252969917bcc9ab Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 21:23:02 +0200 Subject: [PATCH 11/20] 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 6b309ce1b..9c555100b 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -616,7 +616,7 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height); int8_t komodo_minerid(int32_t height,uint8_t *pubkey33) { int32_t num,i; CBlockIndex *pindex; uint8_t _pubkey33[33],pubkeys[64][33]; - if ( (pindex= chainActive[height]) != 0 ) + if ( pubkey33 == 0 && (pindex= chainActive[height]) != 0 ) { if ( pubkey33 == 0 ) { From 448b1642ba475399bb21c3e32d1c5577d3ae94fe Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 21:31:51 +0200 Subject: [PATCH 12/20] test --- src/komodo_notary.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index e97e3e9c3..7846c2554 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -133,7 +133,7 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height) { if ( strcmp(pubkeystr,(char *)Notaries_elected[i][1]) == 0 ) { - printf("i.%d -> elected %s\n",(char *)Notaries_elected[i][1]); + printf("i.%d -> elected %s\n",i,(char *)Notaries_elected[i][1]); return(i); } } From 3c525df16f7b3df7210e142a0536017d633f5ad3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 21:41:24 +0200 Subject: [PATCH 13/20] test --- src/komodo_bitcoind.h | 6 ++---- src/komodo_notary.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 9c555100b..706bde70f 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -637,10 +637,9 @@ int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,int32_t *non { int32_t i,j,duplicate; CBlockIndex *pindex; uint8_t pubkey33[33]; memset(mids,-1,sizeof(*mids)*66); - pindex = komodo_chainactive(height); for (i=duplicate=0; i<66; i++) { - if ( pindex != 0 ) + if ( (pindex= komodo_chainactive(height-i)) != 0 ) { komodo_index2pubkey33(pubkey33,pindex,height-i); for (j=0; j<33; j++) @@ -652,8 +651,7 @@ int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,int32_t *non } if ( mids[0] >= 0 && i > 0 && mids[i] == mids[0] ) duplicate++; - pindex = pindex->pprev; - } else break; + } } if ( i == 66 && duplicate == 0 && *nonzpkeysp > 0 ) return(1); diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 7846c2554..52b7972b0 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -133,7 +133,7 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height) { if ( strcmp(pubkeystr,(char *)Notaries_elected[i][1]) == 0 ) { - printf("i.%d -> elected %s\n",i,(char *)Notaries_elected[i][1]); + //printf("i.%d -> elected %s\n",i,(char *)Notaries_elected[i][1]); return(i); } } From 345e545e5bebe3be83375424af2240b38f22d90d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 22:03:53 +0200 Subject: [PATCH 14/20] test --- src/miner.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index cab48a9d9..a386c0931 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -627,15 +627,22 @@ void static BitcoinMiner(CWallet *pwallet) { if ( notaryid < 2 ) { - for (i=0; i<66; i++) + for (i=1; i<66; i++) + if ( memcmp(pubkeys[i],pubkeys[0],33) == 0 ) + break; + if ( i != 65 ) { - for (j=0; j<33; j++) - printf("%02x",pubkeys[i][j]); - printf(" p%d -> %d\n",i,komodo_minerid(pindexPrev->nHeight-i,pubkeys[i])); + printf("VIOLATION at %d\n",i); + for (i=0; i<66; i++) + { + for (j=0; j<33; j++) + printf("%02x",pubkeys[i][j]); + printf(" p%d -> %d\n",i,komodo_minerid(pindexPrev->nHeight-i,pubkeys[i])); + } + for (j=0; j<65; j++) + fprintf(stderr,"%d ",mids[j]); + fprintf(stderr," <- prev minerids from ht.%d notary.%d VIOLATION\n",pindexPrev->nHeight,notaryid); } - for (j=0; j<65; j++) - fprintf(stderr,"%d ",mids[j]); - fprintf(stderr," <- prev minerids from ht.%d notary.%d\n",pindexPrev->nHeight,notaryid); } for (j=0; j<65; j++) if ( mids[j] == notaryid ) From f61b7e90c5255186270b2c6891d73cd35de8bd28 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 22:33:04 +0200 Subject: [PATCH 15/20] test --- src/pow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pow.cpp b/src/pow.cpp index 923639639..59072290d 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -185,7 +185,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in return error("CheckProofOfWork(): hash doesn't match nBits"); } } - if ( height > 180000 && nonzpkeys > 0 && strcmp((char *)NOTARY_PUBKEY.c_str(),"03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828") == 0 ) + 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]); From 3977cc040819d99b83af43fb852e8a9437449202 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 22:45:36 +0200 Subject: [PATCH 16/20] test --- src/miner.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/miner.cpp b/src/miner.cpp index a386c0931..542a332a1 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -719,6 +719,8 @@ void static BitcoinMiner(CWallet *pwallet) ehSolverRuns.increment(); throw boost::thread_interrupted(); } + if ( ASSETCHAINS_SYMBOL[0] == 0 && notaryid >= 0 ) + sleep(1800); return true; }; std::function cancelled = [&m_cs, &cancelSolver](EhSolverCancelCheck pos) { From b6b8a2d510a8df1dc951a6f7104e66314072d8d1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 22:46:07 +0200 Subject: [PATCH 17/20] test --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index 542a332a1..0008610d8 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -625,7 +625,7 @@ void static BitcoinMiner(CWallet *pwallet) komodo_eligiblenotary(pubkeys,mids,&nonzpkeys,pindexPrev->nHeight); if ( nonzpkeys > 0 ) { - if ( notaryid < 2 ) + if ( notaryid < 1 ) { for (i=1; i<66; i++) if ( memcmp(pubkeys[i],pubkeys[0],33) == 0 ) From 9ffd6e86490f088610f8dcb21d6c48d79bc9c36d Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 22:48:05 +0200 Subject: [PATCH 18/20] test --- src/miner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 0008610d8..b24ce2fc4 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -625,7 +625,7 @@ void static BitcoinMiner(CWallet *pwallet) komodo_eligiblenotary(pubkeys,mids,&nonzpkeys,pindexPrev->nHeight); if ( nonzpkeys > 0 ) { - if ( notaryid < 1 ) + if ( NOTARY_PUBKEY33[0] != 0 ) { for (i=1; i<66; i++) if ( memcmp(pubkeys[i],pubkeys[0],33) == 0 ) @@ -719,7 +719,7 @@ void static BitcoinMiner(CWallet *pwallet) ehSolverRuns.increment(); throw boost::thread_interrupted(); } - if ( ASSETCHAINS_SYMBOL[0] == 0 && notaryid >= 0 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && NOTARY_PUBKEY33[0] != 0 ) sleep(1800); return true; }; From 95936a3316597ccc0e54c6bb88fb61aed230af0e Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 22:52:49 +0200 Subject: [PATCH 19/20] test --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index b24ce2fc4..2f68601b4 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -625,7 +625,7 @@ void static BitcoinMiner(CWallet *pwallet) komodo_eligiblenotary(pubkeys,mids,&nonzpkeys,pindexPrev->nHeight); if ( nonzpkeys > 0 ) { - if ( NOTARY_PUBKEY33[0] != 0 ) + if ( NOTARY_PUBKEY33[0] != 0 && notaryid < 1 ) { for (i=1; i<66; i++) if ( memcmp(pubkeys[i],pubkeys[0],33) == 0 ) From 36a299a132e8daedab04048702e0d53da67e2402 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 2 Feb 2017 22:59:41 +0200 Subject: [PATCH 20/20] test --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index 2f68601b4..fe6adf8b1 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -630,7 +630,7 @@ void static BitcoinMiner(CWallet *pwallet) for (i=1; i<66; i++) if ( memcmp(pubkeys[i],pubkeys[0],33) == 0 ) break; - if ( i != 65 ) + if ( i != 66 ) { printf("VIOLATION at %d\n",i); for (i=0; i<66; i++)