From 92c2aa6ba5f0e5a9e3819bcb5418d861531552b9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Feb 2017 18:22:58 +0200 Subject: [PATCH 1/4] Test for many utxo --- src/wallet/wallet.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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) { From bc653eee608bb5d300a8e0199021f4b78ef201d5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 25 Feb 2017 08:24:00 +0200 Subject: [PATCH 2/4] Test --- src/komodo_gateway.h | 2 +- src/miner.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; ivtx[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); From c96df8ecc921a4b4acd72e697ab933cd36be401c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 25 Feb 2017 08:36:55 +0200 Subject: [PATCH 3/4] Test --- src/miner.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 8385ba80a..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)); From 796bbf8aa3a5fb099592ce2b992398bd4d116fb0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 25 Feb 2017 08:46:55 +0200 Subject: [PATCH 4/4] Test --- src/komodo_pax.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_pax.h b/src/komodo_pax.h index 80f2a75b6..4740436f2 100644 --- a/src/komodo_pax.h +++ b/src/komodo_pax.h @@ -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; 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); return(0); }