policy: make anchor spend standard

Only standard when non-nested.
This commit is contained in:
Greg Sanders 2023-11-03 09:21:48 -04:00
parent 455fca86cf
commit b60aaf8b23

View file

@ -1943,6 +1943,8 @@ static bool VerifyWitnessProgram(const CScriptWitness& witness, int witversion,
}
return set_success(serror);
}
} else if (!is_p2sh && CScript::IsPayToAnchor(witversion, program)) {
return true;
} else {
if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM) {
return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM);