mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Make future parent segwit versions in fedpegscripts be vacuously true
This commit is contained in:
parent
d7faffdca6
commit
44f55d36c0
1 changed files with 9 additions and 0 deletions
|
|
@ -174,6 +174,15 @@ static bool CheckPeginTx(const std::vector<unsigned char>& tx_data, T& pegtx, co
|
|||
// Check that the witness program matches the p2ch on the (p2sh-)p2wsh
|
||||
// transaction output. We support multiple scripts as a grace period for peg-in users
|
||||
for (const auto& scripts : fedpegscripts) {
|
||||
int fedpeg_version = 0;
|
||||
std::vector<unsigned char> fedpeg_program;
|
||||
scripts.first.IsWitnessProgram(fedpeg_version, fedpeg_program);
|
||||
// We immediately return true if any fedpegscripts are unencumbered
|
||||
// by currently-known parent chain segwit versions.
|
||||
// TODO: Refactor for future versionbits deployment of parent-segwit version
|
||||
if (fedpeg_version > 0) {
|
||||
return true;
|
||||
}
|
||||
CScript tweaked_fedpegscript = calculate_contract(scripts.second, claim_script);
|
||||
// TODO: Remove script/standard.h dep for GetScriptFor*
|
||||
CScript expected_script(GetScriptForWitness(tweaked_fedpegscript));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue