Merge #963: [elements-0.18] Add SIGHASH_RANGEPROOF support

4ace925c5 tests: Add test feature_sighash_rangeproof.py (Steven Roose)
559f1d15a Add SIGHASH_RANGEPROOF support (Steven Roose)
cb2d10341 Add set_wif to test frameworks's ECKey (Steven Roose)

Pull request description:

  Backport of #960.

Tree-SHA512: fb97696429c2b7ad101fafcce22d1e9f0bb6450f5c3252dc3cf0ca929b9ac8f63978c9b7115e2f37445b3fff6cae0878f076580256b4333086b020bfb5c99e7a
This commit is contained in:
Steven Roose 2021-03-03 11:31:18 +00:00
commit e163fd06ce
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87
18 changed files with 559 additions and 64 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;
}