mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Make CScriptNum() take nMaxNumSize as an argument
While the existing numeric opcodes are all limited to 4-byte bignum arguments, new opcodes will need different limits.
This commit is contained in:
@@ -195,7 +195,10 @@ public:
|
||||
m_value = n;
|
||||
}
|
||||
|
||||
explicit CScriptNum(const std::vector<unsigned char>& vch, bool fRequireMinimal)
|
||||
static const size_t nDefaultMaxNumSize = 4;
|
||||
|
||||
explicit CScriptNum(const std::vector<unsigned char>& vch, bool fRequireMinimal,
|
||||
const size_t nMaxNumSize = nDefaultMaxNumSize)
|
||||
{
|
||||
if (vch.size() > nMaxNumSize) {
|
||||
throw scriptnum_error("script number overflow");
|
||||
@@ -318,8 +321,6 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
static const size_t nMaxNumSize = 4;
|
||||
|
||||
private:
|
||||
static int64_t set_vch(const std::vector<unsigned char>& vch)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user