diff options
| author | Peter Todd <[email protected]> | 2014-09-29 01:00:01 -0400 |
|---|---|---|
| committer | Peter Todd <[email protected]> | 2015-05-09 04:29:47 -0400 |
| commit | 99088d60d8a7747c6d1a7fd5d8cd388be1b3e138 (patch) | |
| tree | 07b2c24e6eefb91b9bbc749824824d3e62625759 /src/script/script.h | |
| parent | Merge pull request #6117 (diff) | |
| download | discoin-99088d60d8a7747c6d1a7fd5d8cd388be1b3e138.tar.xz discoin-99088d60d8a7747c6d1a7fd5d8cd388be1b3e138.zip | |
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.
Diffstat (limited to 'src/script/script.h')
| -rw-r--r-- | src/script/script.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/script/script.h b/src/script/script.h index ed456f5c5..a4b9de304 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -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) { |