Txheight
This commit is contained in:
26
src/main.cpp
26
src/main.cpp
@@ -1780,7 +1780,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
||||
//fprintf(stderr,"already in mempool\n");
|
||||
return state.Invalid(false, REJECT_DUPLICATE, "already in mempool");
|
||||
}
|
||||
fprintf(stderr,"addmempool 0\n");
|
||||
//fprintf(stderr,"addmempool 0\n");
|
||||
// Node operator can choose to reject tx by number of transparent inputs
|
||||
static_assert(std::numeric_limits<size_t>::max() >= std::numeric_limits<int64_t>::max(), "size_t too small");
|
||||
size_t limit = (size_t) GetArg("-mempooltxinputlimit", 0);
|
||||
@@ -1794,7 +1794,7 @@ fprintf(stderr,"addmempool 0\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
fprintf(stderr,"addmempool 1\n");
|
||||
//fprintf(stderr,"addmempool 1\n");
|
||||
|
||||
auto verifier = libzcash::ProofVerifier::Strict();
|
||||
if ( ASSETCHAINS_SYMBOL[0] == 0 && komodo_validate_interest(tx,chainActive.LastTip()->GetHeight()+1,chainActive.LastTip()->GetMedianTimePast() + 777,0) < 0 )
|
||||
@@ -1812,7 +1812,7 @@ fprintf(stderr,"addmempool 1\n");
|
||||
{
|
||||
return error("AcceptToMemoryPool: ContextualCheckTransaction failed");
|
||||
}
|
||||
fprintf(stderr,"addmempool 2\n");
|
||||
//fprintf(stderr,"addmempool 2\n");
|
||||
// Coinbase is only valid in a block, not as a loose transaction
|
||||
if (tx.IsCoinBase())
|
||||
{
|
||||
@@ -1835,7 +1835,7 @@ fprintf(stderr,"addmempool 2\n");
|
||||
//fprintf(stderr,"AcceptToMemoryPool reject non-final\n");
|
||||
return state.DoS(0, false, REJECT_NONSTANDARD, "non-final");
|
||||
}
|
||||
fprintf(stderr,"addmempool 3\n");
|
||||
//fprintf(stderr,"addmempool 3\n");
|
||||
|
||||
// Check for conflicts with in-memory transactions
|
||||
if (!fSkipExpiry)
|
||||
@@ -1864,7 +1864,7 @@ fprintf(stderr,"addmempool 3\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
fprintf(stderr,"addmempool 4\n");
|
||||
//fprintf(stderr,"addmempool 4\n");
|
||||
|
||||
{
|
||||
CCoinsView dummy;
|
||||
@@ -1964,7 +1964,7 @@ fprintf(stderr,"addmempool 4\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
fprintf(stderr,"addmempool 5\n");
|
||||
//fprintf(stderr,"addmempool 5\n");
|
||||
|
||||
// Grab the branch ID we expect this transaction to commit to. We don't
|
||||
// yet know if it does, but if the entry gets added to the mempool, then
|
||||
@@ -2027,7 +2027,7 @@ fprintf(stderr,"addmempool 5\n");
|
||||
LogPrint("mempool", errmsg.c_str());
|
||||
return state.Error("AcceptToMemoryPool: " + errmsg);
|
||||
}
|
||||
fprintf(stderr,"addmempool 6\n");
|
||||
//fprintf(stderr,"addmempool 6\n");
|
||||
|
||||
// Check against previous transactions
|
||||
// This is done last to help prevent CPU exhaustion denial-of-service attacks.
|
||||
@@ -2053,7 +2053,7 @@ fprintf(stderr,"addmempool 6\n");
|
||||
flag = 1;
|
||||
KOMODO_CONNECTING = (1<<30) + (int32_t)chainActive.LastTip()->GetHeight() + 1;
|
||||
}
|
||||
fprintf(stderr,"addmempool 7\n");
|
||||
//fprintf(stderr,"addmempool 7\n");
|
||||
if (!fSkipExpiry && !ContextualCheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true, txdata, Params().GetConsensus(), consensusBranchId))
|
||||
{
|
||||
if ( flag != 0 )
|
||||
@@ -2229,8 +2229,14 @@ bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlo
|
||||
memset(&hashBlock,0,sizeof(hashBlock));
|
||||
if ( KOMODO_NSPV != 0 )
|
||||
{
|
||||
int64_t rewardsum = 0; int32_t retval,vout = 0;
|
||||
retval = NSPV_gettransaction(1,vout,hash,0,txOut,0,0,rewardsum);
|
||||
int64_t rewardsum = 0; int32_t i,retval,txheight = 0,vout = 0;
|
||||
for (i=0; i<NSPV_U.numutxos; i++)
|
||||
if ( NSPV_U.utxos[i].txid == txid )
|
||||
{
|
||||
txheight = NSPV_U.utxos[i].height;
|
||||
break;
|
||||
}
|
||||
retval = NSPV_gettransaction(1,vout,hash,txheight,txOut,0,0,rewardsum);
|
||||
return(retval == 0);
|
||||
}
|
||||
// need a GetTransaction without lock so the validation code for assets can run without deadlock
|
||||
|
||||
Reference in New Issue
Block a user