Add SIGHASH_RANGEPROOF support

This commit is contained in:
Steven Roose 2021-01-26 17:08:03 +01:00
parent 236f0b1762
commit 691040a63d
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87
11 changed files with 144 additions and 54 deletions

View file

@ -969,7 +969,14 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
}
}
constexpr unsigned int scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS;
unsigned int scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS;
// Temporarily add additional script flags based on the activation of
// Dynamic Federations. This can be included in the
// STANDARD_LOCKTIME_VERIFY_FLAGS in a release post-activation.
if (IsDynaFedEnabled(chainActive.Tip(), chainparams.GetConsensus())) {
scriptVerifyFlags |= SCRIPT_SIGHASH_RANGEPROOF;
}
// Check against previous transactions
// This is done last to help prevent CPU exhaustion denial-of-service attacks.
@ -1902,6 +1909,10 @@ static unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consens
flags |= SCRIPT_VERIFY_NULLDUMMY;
}
if (IsDynaFedEnabled(pindex->pprev, consensusparams)) {
flags |= SCRIPT_SIGHASH_RANGEPROOF;
}
return flags;
}