@@ -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 )
|
||||||
{
|
{
|
||||||
|
|||||||
24
src/main.cpp
24
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 )
|
||||||
@@ -738,16 +738,15 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime,int
|
|||||||
int32_t i;
|
int32_t i;
|
||||||
if (tx.nLockTime == 0)
|
if (tx.nLockTime == 0)
|
||||||
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 || nBlockHeight > 246748 ) // 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;
|
||||||
@@ -899,8 +898,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,libzcash::
|
|||||||
static uint256 array[15]; int32_t j,k,n;
|
static uint256 array[15]; int32_t j,k,n;
|
||||||
if ( *(int32_t *)&array[0] == 0 )
|
if ( *(int32_t *)&array[0] == 0 )
|
||||||
komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array)));
|
komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array)));
|
||||||
//if ( komodo_validate_interest(tx) < 0 )
|
if ( komodo_validate_interest(tx) < 0 )
|
||||||
// return(false);
|
return(false);
|
||||||
n = tx.vin.size();
|
n = tx.vin.size();
|
||||||
for (j=0; j<n; j++)
|
for (j=0; j<n; j++)
|
||||||
{
|
{
|
||||||
@@ -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");
|
||||||
@@ -3316,7 +3320,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
|
|||||||
int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST)
|
int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST)
|
||||||
? pindexPrev->GetMedianTimePast()
|
? pindexPrev->GetMedianTimePast()
|
||||||
: block.GetBlockTime();
|
: 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");
|
return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -846,7 +846,7 @@ void static BitcoinMiner(CWallet *pwallet)
|
|||||||
}
|
}
|
||||||
if ((UintToArith256(pblock->nNonce) & 0xffff) == 0xffff)
|
if ((UintToArith256(pblock->nNonce) & 0xffff) == 0xffff)
|
||||||
{
|
{
|
||||||
if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 )
|
//if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 )
|
||||||
fprintf(stderr,"0xffff, break\n");
|
fprintf(stderr,"0xffff, break\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user