From 68b868fd6ddfb1fded75db93b768fb6e2afbe859 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Jan 2017 14:05:46 +0200 Subject: [PATCH 1/5] test --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f24cfedbd..a55ed39d5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1124,8 +1124,10 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa COutPoint outpoint = tx.vin[i].prevout; if (pool.mapNextTx.count(outpoint)) { + static uint32_t counter; // Disable replacement feature for now - fprintf(stderr,"Disable replacement feature for now\n"); + if ( counter++ < 10 ) + fprintf(stderr,"Disable replacement feature for now\n"); return false; } } From 985e8f155920af82a30454842ef7ffbc7f461d7c Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Jan 2017 14:06:30 +0200 Subject: [PATCH 2/5] Revert "test" This reverts commit 68b868fd6ddfb1fded75db93b768fb6e2afbe859. --- src/main.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a55ed39d5..f24cfedbd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1124,10 +1124,8 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa COutPoint outpoint = tx.vin[i].prevout; if (pool.mapNextTx.count(outpoint)) { - static uint32_t counter; // Disable replacement feature for now - if ( counter++ < 10 ) - fprintf(stderr,"Disable replacement feature for now\n"); + fprintf(stderr,"Disable replacement feature for now\n"); return false; } } From dc64e81e0fb7496e77f0b60f74a3fff36dc465e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 27 Feb 2017 21:45:10 +0200 Subject: [PATCH 3/5] Remove prints --- src/komodo_gateway.h | 3 +-- src/wallet/wallet.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 62b544da6..5b68296f2 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -683,7 +683,6 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above if ( height > 0 && (height < chainActive.Tip()->nHeight || (height >= chainActive.Tip()->nHeight && komodo_isrealtime(&ht) != 0)) && matched != num ) { printf("WOULD REJECT %s: ht.%d (%c) matched.%d vs num.%d tip.%d isRT.%d\n",symbol,height,opcode,matched,num,(int32_t)chainActive.Tip()->nHeight,komodo_isrealtime(&ht)); - // can easily happen depending on order of loading if ( height > 200000 ) { printf("REJECT: ht.%d (%c) matched.%d vs num.%d\n",height,opcode,matched,num); @@ -751,7 +750,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 printf("%02x",pubkey33[i]); printf(" checkpubkey check %.8f v %.8f dest.(%s) kmdheight.%d height.%d\n",dstr(checktoshis),dstr(value),destaddr,kmdheight,height); } - if ( komodo_paxcmp(base,kmdheight,value,checktoshis,kmdheight < 225000 ? seed : 0) == 0 ) + if ( komodo_paxcmp(base,kmdheight,value,checktoshis,kmdheight <= 225000 ? seed : 0) == 0 ) { if ( (pax= komodo_paxfind(txid,vout,'D')) == 0 ) { diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 091fb5e22..45e8875ec 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2669,7 +2669,7 @@ bool CWallet::CreateTransaction(const vector& vecSend, if ( KOMODO_EXCHANGEWALLET == 0 ) { interest2 += pcoin.first->vout[pcoin.second].interest; - fprintf(stderr,"%.8f ",(double)pcoin.first->vout[pcoin.second].interest/COIN); + //fprintf(stderr,"%.8f ",(double)pcoin.first->vout[pcoin.second].interest/COIN); } int age = pcoin.first->GetDepthInMainChain(); if (age != 0) From d8de3e0e986068ebae88514b567cac247dbab640 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 27 Feb 2017 21:45:21 +0200 Subject: [PATCH 4/5] Revert "Remove prints" This reverts commit dc64e81e0fb7496e77f0b60f74a3fff36dc465e3. --- src/komodo_gateway.h | 3 ++- src/wallet/wallet.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 5b68296f2..62b544da6 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -683,6 +683,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above if ( height > 0 && (height < chainActive.Tip()->nHeight || (height >= chainActive.Tip()->nHeight && komodo_isrealtime(&ht) != 0)) && matched != num ) { printf("WOULD REJECT %s: ht.%d (%c) matched.%d vs num.%d tip.%d isRT.%d\n",symbol,height,opcode,matched,num,(int32_t)chainActive.Tip()->nHeight,komodo_isrealtime(&ht)); + // can easily happen depending on order of loading if ( height > 200000 ) { printf("REJECT: ht.%d (%c) matched.%d vs num.%d\n",height,opcode,matched,num); @@ -750,7 +751,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 printf("%02x",pubkey33[i]); printf(" checkpubkey check %.8f v %.8f dest.(%s) kmdheight.%d height.%d\n",dstr(checktoshis),dstr(value),destaddr,kmdheight,height); } - if ( komodo_paxcmp(base,kmdheight,value,checktoshis,kmdheight <= 225000 ? seed : 0) == 0 ) + if ( komodo_paxcmp(base,kmdheight,value,checktoshis,kmdheight < 225000 ? seed : 0) == 0 ) { if ( (pax= komodo_paxfind(txid,vout,'D')) == 0 ) { diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 45e8875ec..091fb5e22 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2669,7 +2669,7 @@ bool CWallet::CreateTransaction(const vector& vecSend, if ( KOMODO_EXCHANGEWALLET == 0 ) { interest2 += pcoin.first->vout[pcoin.second].interest; - //fprintf(stderr,"%.8f ",(double)pcoin.first->vout[pcoin.second].interest/COIN); + fprintf(stderr,"%.8f ",(double)pcoin.first->vout[pcoin.second].interest/COIN); } int age = pcoin.first->GetDepthInMainChain(); if (age != 0) From ec123865e098fe3aca4726e9d9efff02d85010d8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 13 Mar 2017 20:20:46 +0200 Subject: [PATCH 5/5] Test --- src/main.cpp | 12 ++++++++++++ src/miner.cpp | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 307d1d460..be726d4c3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3448,13 +3448,25 @@ bool TestBlockValidity(CValidationState &state, const CBlock& block, CBlockIndex // NOTE: CheckBlockHeader is called by CheckBlock if (!ContextualCheckBlockHeader(block, state, pindexPrev)) + { + fprintf(stderr,"TestBlockValidity A error\n"); return false; + } if (!CheckBlock(indexDummy.nHeight,0,block, state, verifier, fCheckPOW, fCheckMerkleRoot)) + { + fprintf(stderr,"TestBlockValidity B error\n"); return false; + } if (!ContextualCheckBlock(block, state, pindexPrev)) + { + fprintf(stderr,"TestBlockValidity C error\n"); return false; + } if (!ConnectBlock(block, state, &indexDummy, viewNew, true)) + { + fprintf(stderr,"TestBlockValidity D error\n"); return false; + } assert(state.IsValid()); return true; diff --git a/src/miner.cpp b/src/miner.cpp index 376c12c63..6d110a46c 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -605,7 +605,7 @@ void static BitcoinMiner(CWallet *pwallet) Mining_height = pindexPrev->nHeight+1; Mining_start = (uint32_t)time(NULL); } - //if ( ASSETCHAINS_SYMBOL[0] != 0 ) + if ( ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"%s create new block ht.%d\n",ASSETCHAINS_SYMBOL,Mining_height); CBlockTemplate *ptr = CreateNewBlockWithKey(reservekey); if ( ptr == 0 ) @@ -627,7 +627,7 @@ void static BitcoinMiner(CWallet *pwallet) // uint8_t pubkeys[66][33]; int mids[66],gpucount,nonzpkeys,i,j,externalflag; uint32_t savebits; int64_t nStart = GetTime(); savebits = pblock->nBits; - arith_uint256 hashTarget = arith_uint256().SetCompact(pblock->nBits); + ari`th_uint256 hashTarget = arith_uint256().SetCompact(pblock->nBits); if ( ASSETCHAINS_SYMBOL[0] == 0 && notaryid >= 0 )//komodo_is_special(pindexPrev->nHeight+1,NOTARY_PUBKEY33) > 0 ) { j = 65;