From 8ee93080ccd7ab80f6d57f7d7384c1b53d197cc9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 6 Mar 2017 09:50:03 +0200 Subject: [PATCH 01/19] support Undo KOMODO_LASTMINED --- src/komodo.h | 1 + src/komodo_events.h | 6 ++++++ src/komodo_globals.h | 4 ++-- src/miner.cpp | 5 +++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 27e8a53e4..f8df740c0 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -338,6 +338,7 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr if ( i == 0 && j == 0 && memcmp(NOTARY_PUBKEY33,scriptbuf+1,33) == 0 ) { printf("%s KOMODO_LASTMINED.%d -> %d\n",ASSETCHAINS_SYMBOL,KOMODO_LASTMINED,height); + prevKOMODO_LASTMINED = KOMODO_LASTMINED; KOMODO_LASTMINED = height; } decode_hex(crypto777,33,(char *)CRYPTO777_PUBSECPSTR); diff --git a/src/komodo_events.h b/src/komodo_events.h index 14a9478af..2652aaa58 100644 --- a/src/komodo_events.h +++ b/src/komodo_events.h @@ -116,6 +116,12 @@ void komodo_event_rewind(struct komodo_state *sp,char *symbol,int32_t height) struct komodo_event *ep; if ( sp != 0 ) { + if ( ASSETCHAINS_SYMBOL[0] == 0 && height <= KOMODO_LASTMINED && prevKOMODO_LASTMINED != 0 ) + { + printf("undo KOMODO_LASTMINED %d <- %d\n",KOMODO_LASTMINED,prevKOMODO_LASTMINED); + KOMODO_LASTMINED = prevKOMODO_LASTMINED; + prevKOMODO_LASTMINED = 0; + } while ( sp->Komodo_events != 0 && sp->Komodo_numevents > 0 ) { if ( (ep= sp->Komodo_events[sp->Komodo_numevents-1]) != 0 ) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 1faf91a26..55b54ddf8 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -40,7 +40,7 @@ struct komodo_state KOMODO_STATES[34]; int COINBASE_MATURITY = _COINBASE_MATURITY;//100; int32_t IS_KOMODO_NOTARY,KOMODO_REWIND,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET; -int32_t KOMODO_LASTMINED; +int32_t KOMODO_LASTMINED,prevKOMODO_LASTMINED; std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES; uint8_t NOTARY_PUBKEY33[33]; @@ -55,4 +55,4 @@ char KMDUSERPASS[4096],BTCUSERPASS[4096]; uint16_t BITCOIND_PORT = 7771; uint64_t PENDING_KOMODO_TX; struct komodo_kv *KOMODO_KV; -pthread_mutex_t KOMODO_KV_mutex; \ No newline at end of file +pthread_mutex_t KOMODO_KV_mutex; diff --git a/src/miner.cpp b/src/miner.cpp index 6dc5ec03b..0fe7c46f4 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -522,7 +522,7 @@ static bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& rese int32_t komodo_baseid(char *origbase); int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,int32_t *nonzpkeysp,int32_t height); -int32_t FOUND_BLOCK; +int32_t FOUND_BLOCK,KOMODO_MAYBEMINED; extern int32_t KOMODO_LASTMINED; void static BitcoinMiner(CWallet *pwallet) @@ -667,7 +667,7 @@ void static BitcoinMiner(CWallet *pwallet) if ( mids[j] == notaryid ) break; } else fprintf(stderr,"no nonz pubkeys\n"); - if ( j == 65 && Mining_height > KOMODO_LASTMINED+64 ) + if ( j == 65 && Mining_height > KOMODO_MAYBEMINED+3 && Mining_height > KOMODO_LASTMINED+64 ) { hashTarget = arith_uint256().SetCompact(KOMODO_MINDIFF_NBITS); fprintf(stderr,"I am the chosen one for %s ht.%d\n",ASSETCHAINS_SYMBOL,pindexPrev->nHeight+1); @@ -792,6 +792,7 @@ void static BitcoinMiner(CWallet *pwallet) fprintf(stderr,"%02x",((uint8_t *)&hash)[i]); fprintf(stderr," <- %s Block found %d\n",ASSETCHAINS_SYMBOL,Mining_height); FOUND_BLOCK = 1; + KOMODO_MAYBEMINED = Mining_height; break; } } catch (EhSolverCancelledException&) { From ad5e768fba848e54bc8b50a6e8061913f195dce4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 10:29:19 +0200 Subject: [PATCH 02/19] Test --- src/pow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pow.cpp b/src/pow.cpp index 7d8097486..fdcb43936 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -171,7 +171,7 @@ 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 >= 0 || height > 225000 ) + if ( notaryid >= 0 || height > 225065 ) return error("CheckProofOfWork(): hash doesn't match nBits"); } } From 88b8b1365a34aa6dad8d782dc41078fbdd448b8c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 12:29:48 +0200 Subject: [PATCH 03/19] Revert "Merge pull request #224 from jl777/dev" This reverts commit 2b58404ddf3edcde29f64af16a12605da6a9592d, reversing changes made to 536b065b7e11972c6f8e3489ce3b87ffbf53421a. --- src/pow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pow.cpp b/src/pow.cpp index fdcb43936..7d8097486 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -171,7 +171,7 @@ 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 >= 0 || height > 225065 ) + if ( notaryid >= 0 || height > 225000 ) return error("CheckProofOfWork(): hash doesn't match nBits"); } } From 31e2e8a37a08590eb51f2955c59861bd2998bfac Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 12:36:31 +0200 Subject: [PATCH 04/19] Test --- src/komodo_notary.h | 2 ++ src/main.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 52b7972b0..619f41ef8 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -246,6 +246,8 @@ int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33) return(modval); } } + //if ( height >= 250000 ) + return(-1); htind = height / KOMODO_ELECTION_GAP; pthread_mutex_lock(&komodo_mutex); HASH_FIND(hh,Pubkeys[htind].Notaries,pubkey33,33,kp); diff --git a/src/main.cpp b/src/main.cpp index 25d74eb1a..4adbc26a5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3872,6 +3872,7 @@ bool LoadBlockIndex() return false; } KOMODO_LOADINGBLOCKS = 0; + fprintf(stderr,"finished loading blocks\n"); return true; } From add9fc0423fad5449f41727857a4ce228bcb53bc Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 12:44:11 +0200 Subject: [PATCH 05/19] Test --- src/komodo_notary.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 619f41ef8..578b3f9d0 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -229,7 +229,7 @@ void komodo_notarysinit(int32_t origheight,uint8_t pubkeys[64][33],int32_t num) int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33) { // -1 if not notary, 0 if notary, 1 if special notary - struct knotary_entry *kp; int32_t numnotaries=0,htind,modval = -1; + struct knotary_entry *kp; uint8_t legacy33[33]; int32_t numnotaries=0,htind,modval = -1; komodo_init(0); *notaryidp = -1; if ( height < 0 || height >= KOMODO_MAXBLOCKS ) @@ -246,6 +246,9 @@ int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33) return(modval); } } + decode_hex(legacy33,33,"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974"); + if ( memcmp(pubkey33,legacy33,33) == 0 ) + return(63); //if ( height >= 250000 ) return(-1); htind = height / KOMODO_ELECTION_GAP; From 68fc48ec032488c0b8b922684d54979863816cff Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 12:45:29 +0200 Subject: [PATCH 06/19] 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 578b3f9d0..dadd5cc6a 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -246,7 +246,7 @@ int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33) return(modval); } } - decode_hex(legacy33,33,"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974"); + decode_hex(legacy33,33,(char *)"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974"); if ( memcmp(pubkey33,legacy33,33) == 0 ) return(63); //if ( height >= 250000 ) From fd03c52fec033a7add23ef6e41fe210c9642fb56 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 12:51:19 +0200 Subject: [PATCH 07/19] Test --- src/komodo_notary.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index dadd5cc6a..796f10529 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -124,7 +124,7 @@ const char *Notaries_elected[][2] = int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height) { - char pubkeystr[67]; int32_t i; + char pubkeystr[67]; int32_t i; uint8_t legacy33[33]; for (i=0; i<33; i++) sprintf(&pubkeystr[i*2],"%02x",pubkey33[i]); pubkeystr[66] = 0; @@ -137,6 +137,9 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height) return(i); } } + decode_hex(legacy33,33,(char *)"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974"); + if ( memcmp(pubkey33,legacy33,33) == 0 ) + return(63); return(-1); } @@ -229,7 +232,7 @@ void komodo_notarysinit(int32_t origheight,uint8_t pubkeys[64][33],int32_t num) int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33) { // -1 if not notary, 0 if notary, 1 if special notary - struct knotary_entry *kp; uint8_t legacy33[33]; int32_t numnotaries=0,htind,modval = -1; + struct knotary_entry *kp; int32_t numnotaries=0,htind,modval = -1; komodo_init(0); *notaryidp = -1; if ( height < 0 || height >= KOMODO_MAXBLOCKS ) @@ -246,9 +249,6 @@ int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33) return(modval); } } - decode_hex(legacy33,33,(char *)"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974"); - if ( memcmp(pubkey33,legacy33,33) == 0 ) - return(63); //if ( height >= 250000 ) return(-1); htind = height / KOMODO_ELECTION_GAP; From d1f0231f6b4721539e2876060c4103c3e336eea1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 12:55:29 +0200 Subject: [PATCH 08/19] 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 796f10529..9308225d1 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -139,7 +139,7 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height) } decode_hex(legacy33,33,(char *)"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974"); if ( memcmp(pubkey33,legacy33,33) == 0 ) - return(63); + return(64); return(-1); } From f67f5e98b9700244e94adb6a7956fb2a4cb30e3e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 12:56:36 +0200 Subject: [PATCH 09/19] Test --- src/rpcblockchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index c53cfd56e..fc956c99a 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -447,7 +447,7 @@ Value kvsearch(const Array& params, bool fHelp) Value minerids(const Array& params, bool fHelp) { - Object ret; Array a; uint8_t minerids[2000],pubkeys[64][33]; int32_t i,j,n,numnotaries,tally[65]; + Object ret; Array a; uint8_t minerids[2000],pubkeys[65][33]; int32_t i,j,n,numnotaries,tally[66]; if ( fHelp || params.size() != 1 ) throw runtime_error("minerids needs height\n"); LOCK(cs_main); From 7867413c6f2c1c3df5806a8af20fc893846de7c9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 13:02:31 +0200 Subject: [PATCH 10/19] Test --- src/komodo_notary.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 9308225d1..57e4b1f5e 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -140,6 +140,9 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height) decode_hex(legacy33,33,(char *)"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974"); if ( memcmp(pubkey33,legacy33,33) == 0 ) return(64); + decode_hex(legacy33,33,(char *)"03517fcac101fed480ae4f2caf775560065957930d8c1facc83e30077e45bdd199"); + if ( memcmp(pubkey33,legacy33,33) == 0 ) + return(65); return(-1); } From f55023c83d4b51a98a02fabf91d707e085a0c5ac Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 13:09:57 +0200 Subject: [PATCH 11/19] Test --- src/komodo_notary.h | 13 +++++++++---- src/rpcblockchain.cpp | 6 +++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 57e4b1f5e..29d39b622 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -137,12 +137,17 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height) return(i); } } + for (i=0; i elected %s\n",i,(char *)Notaries_elected[i][1]); + return(i+64); + } + } decode_hex(legacy33,33,(char *)"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974"); if ( memcmp(pubkey33,legacy33,33) == 0 ) - return(64); - decode_hex(legacy33,33,(char *)"03517fcac101fed480ae4f2caf775560065957930d8c1facc83e30077e45bdd199"); - if ( memcmp(pubkey33,legacy33,33) == 0 ) - return(65); + return(128); return(-1); } diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index fc956c99a..334d18090 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -447,7 +447,7 @@ Value kvsearch(const Array& params, bool fHelp) Value minerids(const Array& params, bool fHelp) { - Object ret; Array a; uint8_t minerids[2000],pubkeys[65][33]; int32_t i,j,n,numnotaries,tally[66]; + Object ret; Array a; uint8_t minerids[2000],pubkeys[65][33]; int32_t i,j,n,numnotaries,tally[129]; if ( fHelp || params.size() != 1 ) throw runtime_error("minerids needs height\n"); LOCK(cs_main); @@ -463,7 +463,7 @@ Value minerids(const Array& params, bool fHelp) for (i=0; i= numnotaries ) - tally[64]++; + tally[128]++; else tally[minerids[i]]++; } for (i=0; i<64; i++) @@ -488,7 +488,7 @@ Value minerids(const Array& params, bool fHelp) } Object item; item.push_back(Pair("pubkey", (char *)"external miners")); - item.push_back(Pair("blocks", tally[64])); + item.push_back(Pair("blocks", tally[128])); a.push_back(item); } ret.push_back(Pair("mined", a)); From f9ad4d10a5ad06252a5df78dd0e4ce9ab3651f68 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 13:11:45 +0200 Subject: [PATCH 12/19] Test --- src/komodo_notary.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 29d39b622..6b448ed89 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -137,17 +137,20 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height) return(i); } } - for (i=0; i elected %s\n",i,(char *)Notaries_elected[i][1]); - return(i+64); + if ( strcmp(pubkeystr,(char *)Notaries_genesis[i][1]) == 0 ) + { + //printf("i.%d -> elected %s\n",i,(char *)Notaries_elected[i][1]); + return(i+64); + } } + decode_hex(legacy33,33,(char *)"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974"); + if ( memcmp(pubkey33,legacy33,33) == 0 ) + return(128); } - decode_hex(legacy33,33,(char *)"0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974"); - if ( memcmp(pubkey33,legacy33,33) == 0 ) - return(128); return(-1); } From b12e54adf6e2133091d662090f5e977d9ba7be1f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 13:14:08 +0200 Subject: [PATCH 13/19] 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 6b448ed89..c5cb43aa5 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -217,7 +217,7 @@ void komodo_notarysinit(int32_t origheight,uint8_t pubkeys[64][33],int32_t num) memcpy(kp->pubkey,pubkeys[k],33); kp->notaryid = k; HASH_ADD_KEYPTR(hh,N.Notaries,kp->pubkey,33,kp); - if ( 0 && height > 10000 ) + if ( 1 && height > 10000 ) { for (i=0; i<33; i++) printf("%02x",pubkeys[k][i]); From 0bcdcfda0868199fcf767489943a9e31d43e748b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 13:18:10 +0200 Subject: [PATCH 14/19] Test --- src/komodo_notary.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index c5cb43aa5..95cb53d95 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -137,7 +137,7 @@ int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height) return(i); } } - if ( height < 300000 ) + /*if ( height < 300000 ) { for (i=0; i= 250000 ) + if ( height >= 300000 ) return(-1); htind = height / KOMODO_ELECTION_GAP; pthread_mutex_lock(&komodo_mutex); From 3dfd2ff13d3c88caa2fa21d4edeb85880e22772c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 13:44:38 +0200 Subject: [PATCH 15/19] Test --- src/komodo_notary.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 95cb53d95..c8872a3c0 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -272,9 +272,9 @@ int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33) { *notaryidp = kp->notaryid; modval = ((height % numnotaries) == kp->notaryid); - //printf("found notary.%d ht.%d modval.%d\n",kp->notaryid,height,modval); + printf("found notary.%d ht.%d modval.%d\n",kp->notaryid,height,modval); } else printf("unexpected zero notaries at height.%d\n",height); - } + } else printf("cant find kp at htind.%d ht.%d\n",htind,height); //int32_t i; for (i=0; i<33; i++) // printf("%02x",pubkey33[i]); //printf(" ht.%d notary.%d special.%d htind.%d num.%d\n",height,*notaryidp,modval,htind,numnotaries); From 04a5d11d43ea74188b36c03f91f88b19ed545289 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 13:51:37 +0200 Subject: [PATCH 16/19] 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 c8872a3c0..f84c41f71 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -378,7 +378,7 @@ void komodo_init(int32_t height) decode_hex(pubkeys[k],33,(char *)Notaries_elected[k][1]); } printf("set MAINNET notaries.%d\n",k); - komodo_notarysinit(KOMODO_MAINNET_START,pubkeys,k); + //komodo_notarysinit(KOMODO_MAINNET_START,pubkeys,k); } komodo_stateupdate(0,0,0,0,zero,0,0,0,0,0,0,0,0,0,0); } From d111b94be9f77a4fbdd3b55d334637b5f7843033 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 13:52:43 +0200 Subject: [PATCH 17/19] Test --- src/komodo_notary.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index f84c41f71..8ee9cb75b 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -368,7 +368,7 @@ void komodo_init(int32_t height) // Minerids[i] = -2; didinit = 1; } - else if ( height == KOMODO_MAINNET_START ) + else if ( 0 && height == KOMODO_MAINNET_START ) { n = (int32_t)(sizeof(Notaries_elected)/sizeof(*Notaries_elected)); for (k=0; k Date: Sun, 12 Mar 2017 14:07:23 +0200 Subject: [PATCH 18/19] 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 8ee9cb75b..4139c26ae 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -274,7 +274,7 @@ int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33) modval = ((height % numnotaries) == kp->notaryid); printf("found notary.%d ht.%d modval.%d\n",kp->notaryid,height,modval); } else printf("unexpected zero notaries at height.%d\n",height); - } else printf("cant find kp at htind.%d ht.%d\n",htind,height); + } //else printf("cant find kp at htind.%d ht.%d\n",htind,height); //int32_t i; for (i=0; i<33; i++) // printf("%02x",pubkey33[i]); //printf(" ht.%d notary.%d special.%d htind.%d num.%d\n",height,*notaryidp,modval,htind,numnotaries); From 98a3e80f29e9b833480a150b861e0e233471b92e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 12 Mar 2017 14:21:49 +0200 Subject: [PATCH 19/19] 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 4139c26ae..372c74235 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -272,7 +272,7 @@ int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33) { *notaryidp = kp->notaryid; modval = ((height % numnotaries) == kp->notaryid); - printf("found notary.%d ht.%d modval.%d\n",kp->notaryid,height,modval); + //printf("found notary.%d ht.%d modval.%d\n",kp->notaryid,height,modval); } else printf("unexpected zero notaries at height.%d\n",height); } //else printf("cant find kp at htind.%d ht.%d\n",htind,height); //int32_t i; for (i=0; i<33; i++)