From fc921eba57cdd5b98ad2122c81b60b4b0a2c95db Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 9 Jun 2023 00:00:42 -0400 Subject: [PATCH] Remove dead code --- src/miner.cpp | 60 +-------------------------------------------------- 1 file changed, 1 insertion(+), 59 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 4e5e01216..ee85a52eb 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -628,8 +628,6 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 else txNew.nLockTime = std::max((int64_t)(pindexPrev->nTime+1), GetTime()); - if ( SMART_CHAIN_SYMBOL[0] == 0 && IS_HUSH_NOTARY != 0 && My_notaryid >= 0 ) - txNew.vout[0].nValue += 5000; pblock->vtx[0] = txNew; if ( nHeight > 1 && SMART_CHAIN_SYMBOL[0] != 0 && (ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 || ASSETCHAINS_SCRIPTPUB.size() > 1) && (ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_FOUNDERS_REWARD != 0) && (commission= the_commission((CBlock*)&pblocktemplate->block,(int32_t)nHeight)) != 0 ) @@ -1442,8 +1440,6 @@ void static BitcoinMiner() if ( hush_baseid(SMART_CHAIN_SYMBOL) < 0 ) break; } - if ( SMART_CHAIN_SYMBOL[0] == 0 ) - hush_chosennotary(¬aryid,chainActive.LastTip()->GetHeight(),NOTARY_PUBKEY33,(uint32_t)chainActive.LastTip()->GetBlockTime()); if ( notaryid != My_notaryid ) My_notaryid = notaryid; std::string solver; @@ -1573,61 +1569,7 @@ void static BitcoinMiner() savebits = pblock->nBits; HASHTarget = arith_uint256().SetCompact(savebits); roundrobin_delay = ROUNDROBIN_DELAY; - if ( SMART_CHAIN_SYMBOL[0] == 0 && notaryid >= 0 ) - { - j = 65; - 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 ) - dispflag = 1; - hush_eligiblenotary(pubkeys,mids,blocktimes,&nonzpkeys,pindexPrev->GetHeight()); - if ( nonzpkeys > 0 ) - { - for (i=0; i<33; i++) - if( pubkeys[0][i] != 0 ) - break; - if ( i == 33 ) - externalflag = 1; - else externalflag = 0; - if ( IS_HUSH_NOTARY != 0 ) - { - for (i=1; i<66; i++) - if ( memcmp(pubkeys[i],pubkeys[0],33) == 0 ) - break; - if ( externalflag == 0 && i != 66 && mids[i] >= 0 ) - printf("VIOLATION at %d, notaryid.%d\n",i,mids[i]); - for (j=gpucount=0; j<65; j++) - { - if ( dispflag != 0 ) - { - if ( mids[j] >= 0 ) - { - if ( mids[j] == notaryid ) - fprintf(stderr,"--<%d>-- ",mids[j]); - else - fprintf(stderr,"%d ",mids[j]); - } else fprintf(stderr,"GPU "); - } - if ( mids[j] == -1 ) - gpucount++; - } - if ( dispflag != 0 ) - fprintf(stderr," <- prev minerids from ht.%d notary.%d gpucount.%d %.2f%% t.%u\n",pindexPrev->GetHeight(),notaryid,gpucount,100.*(double)gpucount/j,(uint32_t)time(NULL)); - } - for (j=0; j<65; j++) - if ( mids[j] == notaryid ) - break; - if ( j == 65 ) - HUSH_LASTMINED = 0; - } else fprintf(stderr,"no nonz pubkeys\n"); - if ( (Mining_height >= 235300 && Mining_height < 236000) || (j == 65 && Mining_height > HUSH_MAYBEMINED+1 && Mining_height > HUSH_LASTMINED+64) ) - { - HASHTarget = arith_uint256().SetCompact(HUSH_MINDIFF_NBITS); - fprintf(stderr,"I am the chosen one for %s ht.%d\n",SMART_CHAIN_SYMBOL,pindexPrev->GetHeight()+1); - } //else fprintf(stderr,"duplicate at j.%d\n",j); - } else Mining_start = 0; - } else Mining_start = 0; + Mining_start = 0; //else if ( ASSETCHAINS_ADAPTIVEPOW > 0 ) // HASHTarget_POW = hush_adaptivepow_target(Mining_height,HASHTarget,pblock->nTime);