From ad8796cf7c8b78237da00ca6705ed4a56d03f97f Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 21:35:19 +0200 Subject: [PATCH 1/3] Test --- src/miner.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index c73122ffd..dc0628eee 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -206,9 +206,9 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) { if ( expired != 0 ) { - //fprintf(stderr,"expire from mempool tx. need to verify this works\n");//(%d %d) %.8f\n",tx.vins.size(),tx.vouts.size(),(double)tx.vouts[0].nValue/COIN); - //list removed; - //mempool.remove(tx, removed, true); + fprintf(stderr,"expire from mempool tx. need to verify this works\n");//(%d %d) %.8f\n",tx.vins.size(),tx.vouts.size(),(double)tx.vouts[0].nValue/COIN); + list removed; + mempool.remove(tx, removed, true); } continue; } //else fprintf(stderr,"coinbase or is finaltx (%d %u)\n",(int32_t)nHeight,(uint32_t)tx.nLockTime); From a13fb56e553bc1b373ba862f85989ff10c74a285 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 21:40:31 +0200 Subject: [PATCH 2/3] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 777926200..7fa68be9e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -384,7 +384,7 @@ void UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) { ProcessBlockAvailability(nodeid); BlockMap::iterator it = mapBlockIndex.find(hash); - if (it != mapBlockIndex.end() && it->second->nChainWork > 0) { + if (it->second != 0 && it != mapBlockIndex.end() && it->second->nChainWork > 0) { // An actually better block was announced. if (state->pindexBestKnownBlock == NULL || it->second->nChainWork >= state->pindexBestKnownBlock->nChainWork) state->pindexBestKnownBlock = it->second; From 4110a59a4376f576bcf23de5b94ab8089de6d506 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 23 Mar 2017 22:15:29 +0200 Subject: [PATCH 3/3] Test --- src/main.cpp | 2 +- src/miner.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7fa68be9e..99800a600 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -740,7 +740,7 @@ int32_t komodo_validate_interest(uint32_t *expiredp,const CTransaction& tx,uint3 if ( txheighttime > 1490159171 || (locktime == 0 && txheighttime >= 1490159171) ) // 246748 { if ( tx.nLockTime != 1477258935 ) - fprintf(stderr,"komodo_validate_interest reject.%d locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u txb.%u cmp.%u\n",txheight,(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime,txblocktime,cmptime); + fprintf(stderr,"komodo_validate_interest reject.%d [%d] locktime %u/%u vs nBlockTime %u txheighttime.%u tiptime.%u txb.%u cmp.%u\n",txheight,(int32_t)(tx.nLockTime - (cmptime-3600)),(uint32_t)tx.nLockTime,locktime,(uint32_t)chainActive.Tip()->nTime,txheighttime,tiptime,txblocktime,cmptime); if ( expiredp != 0 ) *expiredp = cmptime-3600; return(-1); diff --git a/src/miner.cpp b/src/miner.cpp index dc0628eee..3caf774c0 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -202,13 +202,13 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) ? nMedianTimePast : pblock->GetBlockTime(); - if (tx.IsCoinBase() || !IsFinalTx(&expired,tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS,pblock->nTime)) + if (tx.IsCoinBase() || !IsFinalTx(&expired,tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS,chainActive.Tip()->nTime+600)) { if ( expired != 0 ) { - fprintf(stderr,"expire from mempool tx. need to verify this works\n");//(%d %d) %.8f\n",tx.vins.size(),tx.vouts.size(),(double)tx.vouts[0].nValue/COIN); - list removed; - mempool.remove(tx, removed, true); + //fprintf(stderr,"expire from mempool tx. need to verify this works\n");//(%d %d) %.8f\n",tx.vins.size(),tx.vouts.size(),(double)tx.vouts[0].nValue/COIN); + //list removed; + //mempool.remove(tx, removed, true); } continue; } //else fprintf(stderr,"coinbase or is finaltx (%d %u)\n",(int32_t)nHeight,(uint32_t)tx.nLockTime);