Test
This commit is contained in:
@@ -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));
|
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));
|
} //else fprintf(stderr,"%s.%ld ",CURRENCIES[baseid],ftell(fp));
|
||||||
fclose(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");
|
komodo_statefname(fname,baseid<32?base:(char *)"",(char *)"realtime");
|
||||||
if ( (fp= fopen(fname,"rb")) != 0 )
|
if ( (fp= fopen(fname,"rb")) != 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
14
src/main.cpp
14
src/main.cpp
@@ -716,7 +716,7 @@ int32_t komodo_validate_interest(const CTransaction& tx)
|
|||||||
{
|
{
|
||||||
static uint32_t counter0;
|
static uint32_t counter0;
|
||||||
prevblocktime = chainActive.Tip()->nTime;
|
prevblocktime = chainActive.Tip()->nTime;
|
||||||
if ( counter0++ < 100 )
|
if ( counter0++ < 3 )
|
||||||
fprintf(stderr,"error getting prevblocktime, set to tiptime.%u\n",prevblocktime);
|
fprintf(stderr,"error getting prevblocktime, set to tiptime.%u\n",prevblocktime);
|
||||||
}
|
}
|
||||||
if ( (int64_t)tx.nLockTime < prevblocktime-3600 )
|
if ( (int64_t)tx.nLockTime < prevblocktime-3600 )
|
||||||
@@ -740,14 +740,13 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int
|
|||||||
return true;
|
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 )
|
//if ( komodo_validate_interest(tx) < 0 )
|
||||||
return(false);
|
// return(false);
|
||||||
/*
|
|
||||||
if ( nBlockTime >= 1490159171 ) // 246748
|
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);
|
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
|
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))
|
if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime))
|
||||||
return true;
|
return true;
|
||||||
@@ -1137,6 +1136,11 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
|||||||
if (pfMissingInputs)
|
if (pfMissingInputs)
|
||||||
*pfMissingInputs = false;
|
*pfMissingInputs = false;
|
||||||
auto verifier = libzcash::ProofVerifier::Strict();
|
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))
|
if (!CheckTransaction(tx, state, verifier))
|
||||||
{
|
{
|
||||||
fprintf(stderr,"accept failure.0\n");
|
fprintf(stderr,"accept failure.0\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user