Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 3,616 Lines • ▼ Show 20 Lines | bool ContextualCheckTransaction(const Config &config, const CTransaction &tx, | ||||
int64_t nLockTimeCutoff) { | int64_t nLockTimeCutoff) { | ||||
if (!IsFinalTx(tx, nHeight, nLockTimeCutoff)) { | if (!IsFinalTx(tx, nHeight, nLockTimeCutoff)) { | ||||
// While this is only one transaction, we use txns in the error to | // While this is only one transaction, we use txns in the error to | ||||
// ensure continuity with other clients. | // ensure continuity with other clients. | ||||
return state.DoS(10, false, REJECT_INVALID, "bad-txns-nonfinal", false, | return state.DoS(10, false, REJECT_INVALID, "bad-txns-nonfinal", false, | ||||
"non-final transaction"); | "non-final transaction"); | ||||
} | } | ||||
const Consensus::Params &consensusParams = | |||||
config.GetChainParams().GetConsensus(); | |||||
if (IsUAHFenabled(config, nHeight) && | |||||
nHeight <= consensusParams.antiReplayOpReturnSunsetHeight) { | |||||
for (const CTxOut &o : tx.vout) { | |||||
if (o.scriptPubKey.IsCommitment( | |||||
consensusParams.antiReplayOpReturnCommitment)) { | |||||
return state.DoS(10, false, REJECT_INVALID, "bad-txn-replay", | |||||
false, "non playable transaction"); | |||||
} | |||||
} | |||||
} | |||||
return true; | return true; | ||||
} | } | ||||
bool ContextualCheckTransactionForCurrentBlock(const Config &config, | bool ContextualCheckTransactionForCurrentBlock(const Config &config, | ||||
const CTransaction &tx, | const CTransaction &tx, | ||||
CValidationState &state, | CValidationState &state, | ||||
int flags) { | int flags) { | ||||
AssertLockHeld(cs_main); | AssertLockHeld(cs_main); | ||||
▲ Show 20 Lines • Show All 1,816 Lines • Show Last 20 Lines |