diff options
author | David Hill <dhill@mindcry.org> | 2015-10-13 09:56:45 -0400 |
---|---|---|
committer | David Hill <dhill@mindcry.org> | 2015-10-15 09:48:15 -0400 |
commit | b48da5c1894a70f8fa2a50deb2e056c38ed27ecb (patch) | |
tree | 39578acf78c9cfd4029d8b98bf1d05863058abcd /src/script/script.h | |
parent | d78a880900c15c7a28ae81e6632090f25fea7fce (diff) |
script: Remove magic numbers
This adds two new constants, MAX_OPS_PER_SCRIPT and
MAX_PUBKEYS_PER_MULTISIG.
Diffstat (limited to 'src/script/script.h')
-rw-r--r-- | src/script/script.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/script/script.h b/src/script/script.h index cdc9a71bb2..a38d33a189 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -17,7 +17,14 @@ #include <string> #include <vector> -static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes +// Maximum number of bytes pushable to the stack +static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; + +// Maximum number of non-push operations per script +static const int MAX_OPS_PER_SCRIPT = 201; + +// Maximum number of public keys per multisig +static const int MAX_PUBKEYS_PER_MULTISIG = 20; // Threshold for nLockTime: below this value it is interpreted as block number, // otherwise as UNIX timestamp. |