Browse Source

Remove dead code

pull/305/head
Duke 1 year ago
parent
commit
fc921eba57
  1. 60
      src/miner.cpp

60
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(&notaryid,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);

Loading…
Cancel
Save