This commit is contained in:
jl777
2016-11-20 12:35:00 -03:00
parent 8a7f70639a
commit 106944866d
2 changed files with 14 additions and 10 deletions

View File

@@ -140,7 +140,7 @@ uint64_t komodo_paxtotal()
return(0); return(0);
HASH_ITER(hh,PAX,pax,tmp) HASH_ITER(hh,PAX,pax,tmp)
{ {
printf("pax.%s marked.%d %.8f -> %.8f\n",pax->symbol,pax->marked,dstr(pax->komodoshis),dstr(pax->fiatoshis)); //printf("pax.%s marked.%d %.8f -> %.8f\n",pax->symbol,pax->marked,dstr(pax->komodoshis),dstr(pax->fiatoshis));
if ( pax->marked == 0 ) if ( pax->marked == 0 )
{ {
if ( komodo_is_issuer() != 0 ) if ( komodo_is_issuer() != 0 )

View File

@@ -130,7 +130,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
deposits = komodo_paxtotal(); deposits = komodo_paxtotal();
if ( KOMODO_INITDONE == 0 || (isrealtime= komodo_isrealtime(&kmdheight)) == 0 ) if ( KOMODO_INITDONE == 0 || (isrealtime= komodo_isrealtime(&kmdheight)) == 0 )
{ {
fprintf(stderr,"INITDONE.%d RT.%d deposits %.8f ht.%d\n",KOMODO_INITDONE,isrealtime,(double)deposits/COIN,kmdheight); //fprintf(stderr,"INITDONE.%d RT.%d deposits %.8f ht.%d\n",KOMODO_INITDONE,isrealtime,(double)deposits/COIN,kmdheight);
} }
else if ( deposits != 0 ) else if ( deposits != 0 )
break; break;
@@ -604,7 +604,8 @@ void static BitcoinMiner(CWallet *pwallet)
} else Mining_start = 0; } else Mining_start = 0;
while (true) while (true)
{ {
//fprintf(stderr,"%s start mining loop\n",ASSETCHAINS_SYMBOL); if ( ASSETCHAINS_SYMBOL[0] != 0 )
fprintf(stderr,"%s start mining loop\n",ASSETCHAINS_SYMBOL);
// Hash state // Hash state
KOMODO_CHOSEN_ONE = 0; KOMODO_CHOSEN_ONE = 0;
crypto_generichash_blake2b_state state; crypto_generichash_blake2b_state state;
@@ -631,8 +632,8 @@ void static BitcoinMiner(CWallet *pwallet)
solutionTargetChecks.increment(); solutionTargetChecks.increment();
if ( UintToArith256(pblock->GetHash()) > hashTarget ) if ( UintToArith256(pblock->GetHash()) > hashTarget )
{ {
//if ( ASSETCHAINS_SYMBOL[0] != 0 ) if ( ASSETCHAINS_SYMBOL[0] != 0 )
// printf("missed target\n"); printf("missed target\n");
return false; return false;
} }
if ( ASSETCHAINS_SYMBOL[0] == 0 && Mining_start != 0 && time(NULL) < Mining_start+ROUNDROBIN_DELAY ) if ( ASSETCHAINS_SYMBOL[0] == 0 && Mining_start != 0 && time(NULL) < Mining_start+ROUNDROBIN_DELAY )
@@ -723,24 +724,27 @@ void static BitcoinMiner(CWallet *pwallet)
if (vNodes.empty() && chainparams.MiningRequiresPeers()) if (vNodes.empty() && chainparams.MiningRequiresPeers())
{ {
if ( ASSETCHAINS_SYMBOL[0] == 0 || Mining_height >= 100 ) if ( ASSETCHAINS_SYMBOL[0] == 0 || Mining_height >= 100 )
{
fprintf(stderr,"no nodes, break\n");
break; break;
}
} }
if ((UintToArith256(pblock->nNonce) & 0xffff) == 0xffff) if ((UintToArith256(pblock->nNonce) & 0xffff) == 0xffff)
{ {
if ( ASSETCHAINS_SYMBOL[0] != 0 ) if ( ASSETCHAINS_SYMBOL[0] != 0 )
printf("0xffff, break\n"); fprintf(stderr,"0xffff, break\n");
break; break;
} }
if (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLast && GetTime() - nStart > 60) if (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLast && GetTime() - nStart > 60)
{ {
//if ( ASSETCHAINS_SYMBOL[0] != 0 ) if ( ASSETCHAINS_SYMBOL[0] != 0 )
// printf("timeout, break\n"); fprintf(stderr,"timeout, break\n");
break; break;
} }
if ( pindexPrev != chainActive.Tip() ) if ( pindexPrev != chainActive.Tip() )
{ {
//if ( ASSETCHAINS_SYMBOL[0] != 0 ) if ( ASSETCHAINS_SYMBOL[0] != 0 )
// printf("Tip advanced, break\n"); fprintf(stderr,"Tip advanced, break\n");
break; break;
} }
// Update nNonce and nTime // Update nNonce and nTime