diff --git a/src/hush.h b/src/hush.h index 1570499c9..b25dcfcb4 100644 --- a/src/hush.h +++ b/src/hush.h @@ -944,7 +944,7 @@ int32_t hush_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block) { memset(&txhash,0,sizeof(txhash)); hush_stateupdate(height,pubkeys,numvalid,0,txhash,0,0,0,0,0,0,0,0,0,0,zero,0); - printf("RATIFIED! >>>>>>>>>> new notaries.%d newheight.%d from height.%d\n",numvalid,(((height+KOMODO_ELECTION_GAP/2)/KOMODO_ELECTION_GAP)+1)*KOMODO_ELECTION_GAP,height); + printf("RATIFIED! >>>>>>>>>> new notaries.%d newheight.%d from height.%d\n",numvalid,(((height+HUSH_DPOW_GAP/2)/HUSH_DPOW_GAP)+1)*HUSH_DPOW_GAP,height); } else printf("signedmask.%llx numvalid.%d wt.%d numnotaries.%d\n",(long long)signedmask,numvalid,bitweight(signedmask),numnotaries); } } diff --git a/src/hush_defs.h b/src/hush_defs.h index e51255dd8..190dae86c 100644 --- a/src/hush_defs.h +++ b/src/hush_defs.h @@ -23,7 +23,7 @@ #define HUSH_EARLYTXID_HEIGHT 100 #define ASSETCHAINS_MINHEIGHT 128 #define ASSETCHAINS_MAX_ERAS 7 -#define KOMODO_ELECTION_GAP 2000 +#define HUSH_DPOW_GAP 2000 #define ROUNDROBIN_DELAY 61 #define HUSH_SMART_CHAIN_MAXLEN 65 #define HUSH_LIMITED_NETWORKSIZE 4 diff --git a/src/hush_globals.h b/src/hush_globals.h index 2f3a5eba1..c298d8c15 100644 --- a/src/hush_globals.h +++ b/src/hush_globals.h @@ -34,7 +34,7 @@ int32_t komodo_bannedset(int32_t *indallvoutsp,uint256 *array,int32_t max); int32_t hush_checkvout(int32_t vout,int32_t k,int32_t indallvouts); pthread_mutex_t hush_mutex; -#define KOMODO_ELECTION_GAP 2000 //((SMART_CHAIN_SYMBOL[0] == 0) ? 2000 : 100) +#define HUSH_DPOW_GAP 2000 //((SMART_CHAIN_SYMBOL[0] == 0) ? 2000 : 100) #define HUSH_SMART_CHAIN_MAXLEN 65 struct pax_transaction *PAX; diff --git a/src/hush_notary.h b/src/hush_notary.h index a9280a923..610407df3 100644 --- a/src/hush_notary.h +++ b/src/hush_notary.h @@ -143,17 +143,17 @@ void hush_notarysinit(int32_t origheight,uint8_t pubkeys[64][33],int32_t num) static int32_t hwmheight; int32_t k,i,htind,height; struct knotary_entry *kp; struct knotaries_entry N; if ( Pubkeys == 0 ) - Pubkeys = (struct knotaries_entry *)calloc(1 + (HUSH_MAXBLOCKS / KOMODO_ELECTION_GAP),sizeof(*Pubkeys)); + Pubkeys = (struct knotaries_entry *)calloc(1 + (HUSH_MAXBLOCKS / HUSH_DPOW_GAP),sizeof(*Pubkeys)); memset(&N,0,sizeof(N)); if ( origheight > 0 ) { - height = (origheight + KOMODO_ELECTION_GAP/2); - height /= KOMODO_ELECTION_GAP; - height = ((height + 1) * KOMODO_ELECTION_GAP); - htind = (height / KOMODO_ELECTION_GAP); - if ( htind >= HUSH_MAXBLOCKS / KOMODO_ELECTION_GAP ) - htind = (HUSH_MAXBLOCKS / KOMODO_ELECTION_GAP) - 1; - //printf("htind.%d activation %d from %d vs %d | hwmheight.%d %s\n",htind,height,origheight,(((origheight+KOMODO_ELECTION_GAP/2)/KOMODO_ELECTION_GAP)+1)*KOMODO_ELECTION_GAP,hwmheight,SMART_CHAIN_SYMBOL); + height = (origheight + HUSH_DPOW_GAP/2); + height /= HUSH_DPOW_GAP; + height = ((height + 1) * HUSH_DPOW_GAP); + htind = (height / HUSH_DPOW_GAP); + if ( htind >= HUSH_MAXBLOCKS / HUSH_DPOW_GAP ) + htind = (HUSH_MAXBLOCKS / HUSH_DPOW_GAP) - 1; + //printf("htind.%d activation %d from %d vs %d | hwmheight.%d %s\n",htind,height,origheight,(((origheight+HUSH_DPOW_GAP/2)/HUSH_DPOW_GAP)+1)*HUSH_DPOW_GAP,hwmheight,SMART_CHAIN_SYMBOL); } else htind = 0; pthread_mutex_lock(&hush_mutex); for (k=0; k hwmheight ) @@ -207,9 +207,9 @@ int32_t hush_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33,ui return(-1); if ( Pubkeys == 0 ) hush_init(0); - htind = height / KOMODO_ELECTION_GAP; - if ( htind >= HUSH_MAXBLOCKS / KOMODO_ELECTION_GAP ) - htind = (HUSH_MAXBLOCKS / KOMODO_ELECTION_GAP) - 1; + htind = height / HUSH_DPOW_GAP; + if ( htind >= HUSH_MAXBLOCKS / HUSH_DPOW_GAP ) + htind = (HUSH_MAXBLOCKS / HUSH_DPOW_GAP) - 1; pthread_mutex_lock(&hush_mutex); HASH_FIND(hh,Pubkeys[htind].Notaries,pubkey33,33,kp); pthread_mutex_unlock(&hush_mutex); diff --git a/src/miner.cpp b/src/miner.cpp index 7e5e0361c..2f4b7495e 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -1183,7 +1183,7 @@ void static BitcoinMiner() if ( SMART_CHAIN_SYMBOL[0] == 0 && notaryid >= 0 ) { j = 65; - if ( (Mining_height >= 235300 && Mining_height < 236000) || (Mining_height % KOMODO_ELECTION_GAP) > 64 || (Mining_height % KOMODO_ELECTION_GAP) == 0 || Mining_height > 1000000 ) + if ( (Mining_height >= 235300 && Mining_height < 236000) || (Mining_height % HUSH_DPOW_GAP) > 64 || (Mining_height % HUSH_DPOW_GAP) == 0 || Mining_height > 1000000 ) { int32_t dispflag = 0; if ( notaryid <= 3 || notaryid == 32 || (notaryid >= 43 && notaryid <= 45) || notaryid == 51 || notaryid == 52 || notaryid == 56 || notaryid == 57 ) diff --git a/src/pow.cpp b/src/pow.cpp index e42af6720..143ee71c0 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -677,7 +677,7 @@ bool hush_checkopret(CBlock *pblock, CScript &merkleroot); CScript hush_makeopret(CBlock *pblock, bool fNew); extern int32_t HUSH_CHOSEN_ONE; extern char SMART_CHAIN_SYMBOL[HUSH_SMART_CHAIN_MAXLEN]; -#define KOMODO_ELECTION_GAP 2000 +#define HUSH_DPOW_GAP 2000 int32_t hush_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,uint32_t blocktimes[66],int32_t *nonzpkeysp,int32_t height); int32_t HUSH_LOADINGBLOCKS = 1;