-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blockchain: Ensure no stake opcodes in tx sanity.
This moves the check for validating that output scripts in non-stake transactions do not contain any of the opcodes only allowed in the stake tree to the CheckTransactionSanity function where it more naturally belongs since it does not require access to transaction inputs as its location in CheckTransactionInputs would otherwise indicate. It should be noted that the check just before the one being moved in this change is removed because it checked that specific patterns involving stake opcodes where not being used in non-stake transactions which is a strict subset of the more general check which ensures there are no stake opcodes at all in the output scripts. Also, to improve efficiency, the check is added to the existing loop which already iterates the outputs and the entire block is moved after some other faster checks. Finally, since the transaction sanity code previously did not determine if the transaction is a stake transaction which is required for the check in question, this adds code to relatively efficiently determine that.
- Loading branch information
Showing
2 changed files
with
65 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters