diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 8e9af6a04..84ce254f3 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -1430,7 +1430,7 @@ void komodo_passport_iteration() printf("from.(%s) lastpos[%s] %ld isrt.%d\n",ASSETCHAINS_SYMBOL,CURRENCIES[baseid],lastpos[baseid],komodo_isrealtime(&ht)); } //else fprintf(stderr,"%s.%ld ",CURRENCIES[baseid],ftell(fp)); fclose(fp); - } else printf("error.(%s) %p\n",fname,sp); + } //else printf("error.(%s) %p\n",fname,sp); komodo_statefname(fname,baseid<32?base:(char *)"",(char *)"realtime"); if ( (fp= fopen(fname,"rb")) != 0 ) { diff --git a/src/main.cpp b/src/main.cpp index 2233faed8..627722907 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -716,7 +716,7 @@ int32_t komodo_validate_interest(const CTransaction& tx) { static uint32_t counter0; prevblocktime = chainActive.Tip()->nTime; - if ( counter0++ < 100 ) + if ( counter0++ < 3 ) fprintf(stderr,"error getting prevblocktime, set to tiptime.%u\n",prevblocktime); } if ( (int64_t)tx.nLockTime < prevblocktime-3600 ) @@ -738,16 +738,15 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int int32_t i; if (tx.nLockTime == 0) return true; - if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD )//&& (int64_t)tx.nLockTime < nBlockTime-3600 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && flags == STANDARD_LOCKTIME_VERIFY_FLAGS && (int64_t)tx.nLockTime >= LOCKTIME_THRESHOLD && (int64_t)tx.nLockTime < nBlockTime-3600 ) { - if ( komodo_validate_interest(tx) < 0 ) - return(false); - /* - if ( nBlockTime >= 1490159171 ) // 246748 + //if ( komodo_validate_interest(tx) < 0 ) + // return(false); + if ( nBlockTime >= 1490159171 || nBlockHeight > 246748 ) // 246748 { fprintf(stderr,"[%d] IsFinalTx reject.%d locktime %u vs nBlockTime %u\n",(int32_t)(tx.nLockTime-nBlockTime),(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); return(false); // need to prevent pastdating tx - } else fprintf(stderr,"IsFinalTx grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime);*/ + } else fprintf(stderr,"IsFinalTx grandfather.%d locktime %u vs nBlockTime %u\n",(int32_t)nBlockHeight,tx.nLockTime,(uint32_t)nBlockTime); } if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime)) return true; @@ -899,8 +898,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash:: static uint256 array[15]; int32_t j,k,n; if ( *(int32_t *)&array[0] == 0 ) komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array))); - //if ( komodo_validate_interest(tx) < 0 ) - // return(false); + if ( komodo_validate_interest(tx) < 0 ) + return(false); n = tx.vin.size(); for (j=0; jGetMedianTimePast() : block.GetBlockTime(); - if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,STANDARD_LOCKTIME_VERIFY_FLAGS)) { + if (!IsFinalTx(tx, nHeight, nLockTimeCutoff,0*STANDARD_LOCKTIME_VERIFY_FLAGS)) { return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); } } diff --git a/src/miner.cpp b/src/miner.cpp index ad671896d..ab95c4aa6 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -846,7 +846,7 @@ void static BitcoinMiner(CWallet *pwallet) } if ((UintToArith256(pblock->nNonce) & 0xffff) == 0xffff) { - if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) + //if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 ) fprintf(stderr,"0xffff, break\n"); break; }