From b48da5c1894a70f8fa2a50deb2e056c38ed27ecb Mon Sep 17 00:00:00 2001 From: David Hill Date: Tue, 13 Oct 2015 09:56:45 -0400 Subject: script: Remove magic numbers This adds two new constants, MAX_OPS_PER_SCRIPT and MAX_PUBKEYS_PER_MULTISIG. --- src/script/script.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/script/script.h') diff --git a/src/script/script.h b/src/script/script.h index cdc9a71bb..a38d33a18 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -17,7 +17,14 @@ #include #include -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. -- cgit v1.2.3