forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accurate sigop/sighash accounting and limits
Adds a ValidationCostTracker class that is passed to CheckInputs() / CScriptCheck() to keep track of the exact number of signature operations required to validate a block, and the exact number of bytes hashed to compute signature hashes. Also extends CHashWriter to keep track of number of bytes hashed. Signature operations per block are limited to MAX_BLOCK_SIGOPS (unchanged at 20,000) Bytes hashed to compute signatures is limited to MAX_BLOCK_SIGHASH (1.3 GB in this commit).
- Loading branch information
1 parent
d86ff54
commit 842dc24
Showing
8 changed files
with
143 additions
and
30 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
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
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
Oops, something went wrong.
This line and the one above are tricky to read because they only includes 7 arguments, but CheckInputs is defined with 8 arguments. Thus, to feeble human minds (like mine), it may seem that the NULL here is being used for pvChecks (the last argument) instead of costTracker (the 7th argument).
This is a preexisting issue, and was not introduced in this commit.
(Note: I deleted a comment I made a few minutes ago stating that the arguments were mixed up.)