MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / ContextualCheckTransaction

Function ContextualCheckTransaction

src/main.cpp:3410–3425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3408}
3409
3410bool ContextualCheckTransaction(const CTransaction &tx, CValidationState &state, int nHeight,
3411 int64_t nLockTimeCutoff, int64_t nMedianTimePastPrev) {
3412 if (!IsFinalTx(tx, nHeight, nLockTimeCutoff)) {
3413 return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal");
3414 }
3415 if ((Opt().UAHFTime() != 0) &&
3416 (nMedianTimePastPrev >= Opt().UAHFTime()) &&
3417 (nHeight <= Opt().UAHFProtectSunset())) {
3418 for (const CTxOut &o : tx.vout) {
3419 if (o.scriptPubKey.IsCommitment(GetAntiReplayCommitment())) {
3420 return state.DoS(10, error("%s: chain protected from tx", __func__), REJECT_INVALID, "bad-txn-replay");
3421 }
3422 }
3423 }
3424 return true;
3425}
3426
3427bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIndex * const pindexPrev)
3428{

Callers 2

BOOST_FOREACHFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 7

IsFinalTxFunction · 0.85
errorFunction · 0.85
OptClass · 0.85
DoSMethod · 0.80
UAHFTimeMethod · 0.80
UAHFProtectSunsetMethod · 0.80
IsCommitmentMethod · 0.80

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68