diff options
Diffstat (limited to 'src/script.h')
| -rw-r--r-- | src/script.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/script.h b/src/script.h index 26bb65a..d36a317 100644 --- a/src/script.h +++ b/src/script.h | |||
| @@ -8,6 +8,15 @@ class CTransaction; | |||
| 8 | // script evaluation allocates whatever the transaction asks it to. | 8 | // script evaluation allocates whatever the transaction asks it to. |
| 9 | static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; | 9 | static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; |
| 10 | 10 | ||
| 11 | // Bounds on what one script may do while being evaluated. The element cap | ||
| 12 | // above limits how big a single item is; these limit how many there can be and | ||
| 13 | // how much work producing them costs. Without them, a script pays for itself | ||
| 14 | // once, in bytes, and then multiplies: 520 bytes per stack entry means a | ||
| 15 | // script of N bytes made almost entirely of OP_DUP occupies roughly 520N in | ||
| 16 | // memory, and every node that validates it pays. | ||
| 17 | static const unsigned int MAX_OPS_PER_SCRIPT = 201; | ||
| 18 | static const unsigned int MAX_STACK_SIZE = 1000; | ||
| 19 | |||
| 11 | enum | 20 | enum |
| 12 | { | 21 | { |
| 13 | SIGHASH_ALL = 1, | 22 | SIGHASH_ALL = 1, |