Merge pull request #210 from jl777/dev

Dev
This commit is contained in:
jl777
2017-02-25 08:56:51 +02:00
committed by GitHub
4 changed files with 13 additions and 6 deletions

View File

@@ -834,7 +834,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
} }
else if ( opretbuf[0] == 'W' )//&& opretlen >= 38 ) else if ( opretbuf[0] == 'W' )//&& opretlen >= 38 )
{ {
if ( komodo_baseid((char *)&opretbuf[opretlen-4]) >= 0 && strcmp("KMD",(char *)&opretbuf[opretlen-4]) != 0 ) if ( komodo_baseid((char *)&opretbuf[opretlen-4]) >= 0 && strcmp(ASSETCHAINS_SYMBOL,(char *)&opretbuf[opretlen-4]) == 0 )
{ {
for (i=0; i<opretlen; i++) for (i=0; i<opretlen; i++)
printf("%02x",opretbuf[i]); printf("%02x",opretbuf[i]);

View File

@@ -528,7 +528,7 @@ uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uin
int32_t i,nonz=0; int64_t diff; uint64_t price,seed,sum = 0; int32_t i,nonz=0; int64_t diff; uint64_t price,seed,sum = 0;
if ( ASSETCHAINS_SYMBOL[0] == 0 && chainActive.Tip() != 0 && height > chainActive.Tip()->nHeight ) if ( ASSETCHAINS_SYMBOL[0] == 0 && chainActive.Tip() != 0 && height > chainActive.Tip()->nHeight )
{ {
if ( height < 1381319936 ) if ( height < 100000000 )
printf("height.%d vs tip.%d\n",height,chainActive.Tip()->nHeight); printf("height.%d vs tip.%d\n",height,chainActive.Tip()->nHeight);
return(0); return(0);
} }

View File

@@ -552,7 +552,8 @@ void static BitcoinMiner(CWallet *pwallet)
//else solver = "default"; //else solver = "default";
assert(solver == "tromp" || solver == "default"); assert(solver == "tromp" || solver == "default");
LogPrint("pow", "Using Equihash solver \"%s\" with n = %u, k = %u\n", solver, n, k); LogPrint("pow", "Using Equihash solver \"%s\" with n = %u, k = %u\n", solver, n, k);
//fprintf(stderr,"Mining with %s\n",solver.c_str()); if ( ASSETCHAINS_SYMBOL[0] != 0 )
fprintf(stderr,"Mining with %s\n",solver.c_str());
std::mutex m_cs; std::mutex m_cs;
bool cancelSolver = false; bool cancelSolver = false;
boost::signals2::connection c = uiInterface.NotifyBlockTip.connect( boost::signals2::connection c = uiInterface.NotifyBlockTip.connect(
@@ -563,7 +564,8 @@ void static BitcoinMiner(CWallet *pwallet)
); );
try { try {
//fprintf(stderr,"try %s Mining with %s\n",ASSETCHAINS_SYMBOL,solver.c_str()); if ( ASSETCHAINS_SYMBOL[0] != 0 )
fprintf(stderr,"try %s Mining with %s\n",ASSETCHAINS_SYMBOL,solver.c_str());
while (true) while (true)
{ {
if (chainparams.MiningRequiresPeers()) if (chainparams.MiningRequiresPeers())
@@ -602,7 +604,7 @@ void static BitcoinMiner(CWallet *pwallet)
Mining_height = pindexPrev->nHeight+1; Mining_height = pindexPrev->nHeight+1;
Mining_start = (uint32_t)time(NULL); Mining_start = (uint32_t)time(NULL);
} }
if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) if ( ASSETCHAINS_SYMBOL[0] != 0 )
fprintf(stderr,"%s create new block ht.%d\n",ASSETCHAINS_SYMBOL,Mining_height); fprintf(stderr,"%s create new block ht.%d\n",ASSETCHAINS_SYMBOL,Mining_height);
unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey)); unique_ptr<CBlockTemplate> pblocktemplate(CreateNewBlockWithKey(reservekey));
@@ -668,7 +670,7 @@ void static BitcoinMiner(CWallet *pwallet)
} else Mining_start = 0; } else Mining_start = 0;
while (true) while (true)
{ {
if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 && pblock->vtx[0].vout.size() == 1 && Mining_height > ASSETCHAINS_MINHEIGHT ) if ( ASSETCHAINS_SYMBOL[0] != 0 && pblock->vtx[0].vout.size() == 1 && Mining_height > ASSETCHAINS_MINHEIGHT )
{ {
fprintf(stderr,"skip generating %s on-demand block, no tx avail\n",ASSETCHAINS_SYMBOL); fprintf(stderr,"skip generating %s on-demand block, no tx avail\n",ASSETCHAINS_SYMBOL);
sleep(10); sleep(10);

View File

@@ -2384,6 +2384,11 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int
//fprintf(stderr,"count.%d %.8f\n",count,(double)pcoin->vout[i].interest/COIN); //fprintf(stderr,"count.%d %.8f\n",count,(double)pcoin->vout[i].interest/COIN);
interests[count++] = pcoin->vout[i].interest; interests[count++] = pcoin->vout[i].interest;
} }
if ( nTotalLower > 2*nTargetValue + CENT )
{
fprintf(stderr,"why bother with all the utxo if we have double what is needed?\n");
break;
}
} }
else if (n < coinLowestLarger.first) else if (n < coinLowestLarger.first)
{ {