Permalink
Browse files

Reject from mempool the OP_RETURN anti-replay transactions.

When we are in the UAHF chain, and before the sunset height.
  • Loading branch information...
zander committed Jul 30, 2017
1 parent c5adb3a commit e1beca728ddad38d3e6260f134e975427708ac03
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/main.cpp
View
@@ -1102,8 +1102,18 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C
}
uint32_t scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS;
if (Application::uahfChainState() >= Application::UAHFRulesActive)
if (Application::uahfChainState() >= Application::UAHFRulesActive) {
// reject in memory pool transactions that use the OP_RETURN anti-replay ID.
// Remove this code after the sunset height has been reached.
const auto consensusParams = Params().GetConsensus();
if (chainActive.Height() <= consensusParams.antiReplayOpReturnSunsetHeight) {
for (const CTxOut &o : tx.vout) {
if (o.scriptPubKey.isCommitment(consensusParams.antiReplayOpReturnCommitment))
return false;
}
}
scriptVerifyFlags |= SCRIPT_ENABLE_SIGHASH_FORKID;
}
// Check against previous transactions
// This is done last to help prevent CPU exhaustion denial-of-service attacks.

0 comments on commit e1beca7

Please sign in to comment.