mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Merge pull request #6124
ffd75adEnable CHECKLOCKTIMEVERIFY as a standard script verify flag (Peter Todd)bc60b2bReplace NOP2 with CHECKLOCKTIMEVERIFY (BIP65) (Peter Todd)48e9c57Move LOCKTIME_THRESHOLD to src/script/script.h (Peter Todd)99088d6Make CScriptNum() take nMaxNumSize as an argument (Peter Todd)
This commit is contained in:
@@ -19,6 +19,10 @@
|
||||
|
||||
static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes
|
||||
|
||||
// Threshold for nLockTime: below this value it is interpreted as block number,
|
||||
// otherwise as UNIX timestamp.
|
||||
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC
|
||||
|
||||
template <typename T>
|
||||
std::vector<unsigned char> ToByteVector(const T& in)
|
||||
{
|
||||
@@ -151,6 +155,7 @@ enum opcodetype
|
||||
// expansion
|
||||
OP_NOP1 = 0xb0,
|
||||
OP_NOP2 = 0xb1,
|
||||
OP_CHECKLOCKTIMEVERIFY = OP_NOP2,
|
||||
OP_NOP3 = 0xb2,
|
||||
OP_NOP4 = 0xb3,
|
||||
OP_NOP5 = 0xb4,
|
||||
@@ -196,7 +201,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");
|
||||
@@ -319,8 +327,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