Changed the comments in the last commit (no relevant changes in the code).

After looking into the code, I think the workaround (removing some Flags from ALL_VERIFY_FLAGS) is not a workaround, but a valid and needed change, in order to keep the existing functionality.

Still, I consider that a deep research into the code is needed, in order to refactor all the uses of these Flags. Since these Flags affect the way the script is executed, the different invocations to the script engine should be aware of what flags are being used (as a parameter, for example). At this moment, these Flags are hardcoded, and that should not be the case (unless there is a clear consensus about that).

The current commit runs OK and the legacy tests also run OK. But we should make it clear that ALL_VERIFY_FLAGS doen NOT measn ALL of them, just the ones that allow a "safe" script execution.
parent f42befcd
...@@ -104,7 +104,7 @@ public class Script { ...@@ -104,7 +104,7 @@ public class Script {
// A possible solution might be to parameterize all the calls to the Script Engine, adding the Flags as a new // A possible solution might be to parameterize all the calls to the Script Engine, adding the Flags as a new
// parameter, and refactor the whole project so every single call needs to acknowledge the Verification Flags used. // parameter, and refactor the whole project so every single call needs to acknowledge the Verification Flags used.
// This refactoring is a possible solution. At this moment, and in order not to break the existing code and the // This refactoring is a possible solution. At this moment, and in order not to break the existing code and the
// legacy tests, we remove from the SET those flags which affect the Script the most and might break the legacy code. // legacy tests, we remove from the SET those flags which affect the Script the most and might break the legacy code
public static final EnumSet<VerifyFlag> ALL_VERIFY_FLAGS = EnumSet.complementOf(EnumSet.of(VerifyFlag.SIGHASH_FORKID, VerifyFlag.REPLAY_PROTECTION)); public static final EnumSet<VerifyFlag> ALL_VERIFY_FLAGS = EnumSet.complementOf(EnumSet.of(VerifyFlag.SIGHASH_FORKID, VerifyFlag.REPLAY_PROTECTION));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment