mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Add constant for maximum stack size
This commit is contained in:
parent
a3e756b7d6
commit
cb184b3a54
@ -1028,7 +1028,7 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Size limits
|
// Size limits
|
||||||
if (stack.size() + altstack.size() > 1000)
|
if (stack.size() + altstack.size() > MAX_STACK_SIZE)
|
||||||
return set_error(serror, SCRIPT_ERR_STACK_SIZE);
|
return set_error(serror, SCRIPT_ERR_STACK_SIZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,9 @@ static const int MAX_PUBKEYS_PER_MULTISIG = 20;
|
|||||||
// Maximum script length in bytes
|
// Maximum script length in bytes
|
||||||
static const int MAX_SCRIPT_SIZE = 10000;
|
static const int MAX_SCRIPT_SIZE = 10000;
|
||||||
|
|
||||||
|
// Maximum number of values on script interpreter stack
|
||||||
|
static const int MAX_STACK_SIZE = 1000;
|
||||||
|
|
||||||
// Threshold for nLockTime: below this value it is interpreted as block number,
|
// Threshold for nLockTime: below this value it is interpreted as block number,
|
||||||
// otherwise as UNIX timestamp.
|
// otherwise as UNIX timestamp.
|
||||||
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC
|
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC
|
||||||
|
Loading…
Reference in New Issue
Block a user