This commit is contained in:
jl777
2017-03-22 15:56:36 +02:00
parent 198286a59a
commit e7fa1876d5
2 changed files with 10 additions and 6 deletions

View File

@@ -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 )
{

View File

@@ -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 )
@@ -740,14 +740,13 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int
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 ( komodo_validate_interest(tx) < 0 )
return(false);
/*
//if ( komodo_validate_interest(tx) < 0 )
// return(false);
if ( nBlockTime >= 1490159171 ) // 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;
@@ -1137,6 +1136,11 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
if (pfMissingInputs)
*pfMissingInputs = false;
auto verifier = libzcash::ProofVerifier::Strict();
if ( komodo_validate_interest(tx) < 0 )
{
fprintf(stderr,"komodo_validate_interest failure\n");
return error("AcceptToMemoryPool: komodo_validate_interest failed");
}
if (!CheckTransaction(tx, state, verifier))
{
fprintf(stderr,"accept failure.0\n");