diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 9176bffe1..3ef2c91c4 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -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 ) { - 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 chainActive.Tip()->nHeight ) { - if ( height < 1381319936 ) + if ( height < 100000000 ) printf("height.%d vs tip.%d\n",height,chainActive.Tip()->nHeight); return(0); } diff --git a/src/miner.cpp b/src/miner.cpp index 26166a416..042bda961 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -552,7 +552,8 @@ void static BitcoinMiner(CWallet *pwallet) //else solver = "default"; assert(solver == "tromp" || solver == "default"); 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; bool cancelSolver = false; boost::signals2::connection c = uiInterface.NotifyBlockTip.connect( @@ -563,7 +564,8 @@ void static BitcoinMiner(CWallet *pwallet) ); 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) { if (chainparams.MiningRequiresPeers()) @@ -602,7 +604,7 @@ void static BitcoinMiner(CWallet *pwallet) Mining_height = pindexPrev->nHeight+1; 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); unique_ptr pblocktemplate(CreateNewBlockWithKey(reservekey)); @@ -668,7 +670,7 @@ void static BitcoinMiner(CWallet *pwallet) } else Mining_start = 0; 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); sleep(10); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 48bacd562..05a18c8cf 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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); 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) {