Skip to content

Commit 41076aa

Browse files
committed
Merge pull request #6124
ffd75ad Enable CHECKLOCKTIMEVERIFY as a standard script verify flag (Peter Todd) bc60b2b Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65) (Peter Todd) 48e9c57 Move LOCKTIME_THRESHOLD to src/script/script.h (Peter Todd) 99088d6 Make CScriptNum() take nMaxNumSize as an argument (Peter Todd)
2 parents 5aa34c7 + ffd75ad commit 41076aa

11 files changed

+220
-10
lines changed

Diff for: src/consensus/consensus.h

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ static const unsigned int MAX_BLOCK_SIZE = 1000000;
1212
static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
1313
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
1414
static const int COINBASE_MATURITY = 100;
15-
/** Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. */
16-
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC
1715

1816
#endif // BITCOIN_CONSENSUS_CONSENSUS_H

Diff for: src/script/interpreter.cpp

+81-2
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,51 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
335335
// Control
336336
//
337337
case OP_NOP:
338-
break;
338+
break;
339+
340+
case OP_CHECKLOCKTIMEVERIFY:
341+
{
342+
if (!(flags & SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)) {
343+
// not enabled; treat as a NOP2
344+
if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) {
345+
return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS);
346+
}
347+
break;
348+
}
349+
350+
if (stack.size() < 1)
351+
return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
352+
353+
// Note that elsewhere numeric opcodes are limited to
354+
// operands in the range -2**31+1 to 2**31-1, however it is
355+
// legal for opcodes to produce results exceeding that
356+
// range. This limitation is implemented by CScriptNum's
357+
// default 4-byte limit.
358+
//
359+
// If we kept to that limit we'd have a year 2038 problem,
360+
// even though the nLockTime field in transactions
361+
// themselves is uint32 which only becomes meaningless
362+
// after the year 2106.
363+
//
364+
// Thus as a special case we tell CScriptNum to accept up
365+
// to 5-byte bignums, which are good until 2**39-1, well
366+
// beyond the 2**32-1 limit of the nLockTime field itself.
367+
const CScriptNum nLockTime(stacktop(-1), fRequireMinimal, 5);
368+
369+
// In the rare event that the argument may be < 0 due to
370+
// some arithmetic being done first, you can always use
371+
// 0 MAX CHECKLOCKTIMEVERIFY.
372+
if (nLockTime < 0)
373+
return set_error(serror, SCRIPT_ERR_NEGATIVE_LOCKTIME);
374+
375+
// Actually compare the specified lock time with the transaction.
376+
if (!checker.CheckLockTime(nLockTime))
377+
return set_error(serror, SCRIPT_ERR_UNSATISFIED_LOCKTIME);
378+
379+
break;
380+
}
339381

340-
case OP_NOP1: case OP_NOP2: case OP_NOP3: case OP_NOP4: case OP_NOP5:
382+
case OP_NOP1: case OP_NOP3: case OP_NOP4: case OP_NOP5:
341383
case OP_NOP6: case OP_NOP7: case OP_NOP8: case OP_NOP9: case OP_NOP10:
342384
{
343385
if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)
@@ -1084,6 +1126,43 @@ bool TransactionSignatureChecker::CheckSig(const vector<unsigned char>& vchSigIn
10841126
return true;
10851127
}
10861128

1129+
bool TransactionSignatureChecker::CheckLockTime(const CScriptNum& nLockTime) const
1130+
{
1131+
// There are two times of nLockTime: lock-by-blockheight
1132+
// and lock-by-blocktime, distinguished by whether
1133+
// nLockTime < LOCKTIME_THRESHOLD.
1134+
//
1135+
// We want to compare apples to apples, so fail the script
1136+
// unless the type of nLockTime being tested is the same as
1137+
// the nLockTime in the transaction.
1138+
if (!(
1139+
(txTo->nLockTime < LOCKTIME_THRESHOLD && nLockTime < LOCKTIME_THRESHOLD) ||
1140+
(txTo->nLockTime >= LOCKTIME_THRESHOLD && nLockTime >= LOCKTIME_THRESHOLD)
1141+
))
1142+
return false;
1143+
1144+
// Now that we know we're comparing apples-to-apples, the
1145+
// comparison is a simple numeric one.
1146+
if (nLockTime > (int64_t)txTo->nLockTime)
1147+
return false;
1148+
1149+
// Finally the nLockTime feature can be disabled and thus
1150+
// CHECKLOCKTIMEVERIFY bypassed if every txin has been
1151+
// finalized by setting nSequence to maxint. The
1152+
// transaction would be allowed into the blockchain, making
1153+
// the opcode ineffective.
1154+
//
1155+
// Testing if this vin is not final is sufficient to
1156+
// prevent this condition. Alternatively we could test all
1157+
// inputs, but testing just this input minimizes the data
1158+
// required to prove correct CHECKLOCKTIMEVERIFY execution.
1159+
if (txTo->vin[nIn].IsFinal())
1160+
return false;
1161+
1162+
return true;
1163+
}
1164+
1165+
10871166
bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror)
10881167
{
10891168
set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR);

Diff for: src/script/interpreter.h

+11
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ enum
7676
// (softfork safe, BIP62 rule 6)
7777
// Note: CLEANSTACK should never be used without P2SH.
7878
SCRIPT_VERIFY_CLEANSTACK = (1U << 8),
79+
80+
// Verify CHECKLOCKTIMEVERIFY
81+
//
82+
// See BIP65 for details.
83+
SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9),
7984
};
8085

8186
uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType);
@@ -88,6 +93,11 @@ class BaseSignatureChecker
8893
return false;
8994
}
9095

96+
virtual bool CheckLockTime(const CScriptNum& nLockTime) const
97+
{
98+
return false;
99+
}
100+
91101
virtual ~BaseSignatureChecker() {}
92102
};
93103

@@ -103,6 +113,7 @@ class TransactionSignatureChecker : public BaseSignatureChecker
103113
public:
104114
TransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn) : txTo(txToIn), nIn(nInIn) {}
105115
bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode) const;
116+
bool CheckLockTime(const CScriptNum& nLockTime) const;
106117
};
107118

108119
class MutableTransactionSignatureChecker : public TransactionSignatureChecker

Diff for: src/script/script.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes
2121

22+
// Threshold for nLockTime: below this value it is interpreted as block number,
23+
// otherwise as UNIX timestamp.
24+
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC
25+
2226
template <typename T>
2327
std::vector<unsigned char> ToByteVector(const T& in)
2428
{
@@ -151,6 +155,7 @@ enum opcodetype
151155
// expansion
152156
OP_NOP1 = 0xb0,
153157
OP_NOP2 = 0xb1,
158+
OP_CHECKLOCKTIMEVERIFY = OP_NOP2,
154159
OP_NOP3 = 0xb2,
155160
OP_NOP4 = 0xb3,
156161
OP_NOP5 = 0xb4,
@@ -196,7 +201,10 @@ class CScriptNum
196201
m_value = n;
197202
}
198203

199-
explicit CScriptNum(const std::vector<unsigned char>& vch, bool fRequireMinimal)
204+
static const size_t nDefaultMaxNumSize = 4;
205+
206+
explicit CScriptNum(const std::vector<unsigned char>& vch, bool fRequireMinimal,
207+
const size_t nMaxNumSize = nDefaultMaxNumSize)
200208
{
201209
if (vch.size() > nMaxNumSize) {
202210
throw scriptnum_error("script number overflow");
@@ -319,8 +327,6 @@ class CScriptNum
319327
return result;
320328
}
321329

322-
static const size_t nMaxNumSize = 4;
323-
324330
private:
325331
static int64_t set_vch(const std::vector<unsigned char>& vch)
326332
{

Diff for: src/script/script_error.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ const char* ScriptErrorString(const ScriptError serror)
4747
return "OP_RETURN was encountered";
4848
case SCRIPT_ERR_UNBALANCED_CONDITIONAL:
4949
return "Invalid OP_IF construction";
50+
case SCRIPT_ERR_NEGATIVE_LOCKTIME:
51+
return "Negative locktime";
52+
case SCRIPT_ERR_UNSATISFIED_LOCKTIME:
53+
return "Locktime requirement not satisfied";
5054
case SCRIPT_ERR_SIG_HASHTYPE:
5155
return "Signature hash type missing or not understood";
5256
case SCRIPT_ERR_SIG_DER:

Diff for: src/script/script_error.h

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ typedef enum ScriptError_t
3535
SCRIPT_ERR_INVALID_ALTSTACK_OPERATION,
3636
SCRIPT_ERR_UNBALANCED_CONDITIONAL,
3737

38+
/* OP_CHECKLOCKTIMEVERIFY */
39+
SCRIPT_ERR_NEGATIVE_LOCKTIME,
40+
SCRIPT_ERR_UNSATISFIED_LOCKTIME,
41+
3842
/* BIP62 */
3943
SCRIPT_ERR_SIG_HASHTYPE,
4044
SCRIPT_ERR_SIG_DER,

Diff for: src/script/standard.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY
5050
SCRIPT_VERIFY_MINIMALDATA |
5151
SCRIPT_VERIFY_NULLDUMMY |
5252
SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS |
53-
SCRIPT_VERIFY_CLEANSTACK;
53+
SCRIPT_VERIFY_CLEANSTACK |
54+
SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY;
5455

5556
/** For convenience, standard but not mandatory verify flags. */
5657
static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS;

Diff for: src/test/data/tx_invalid.json

+64
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,70 @@
120120
[[["a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944", 0, "IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1"]],
121121
"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a483045022100fa4a74ba9fd59c59f46c3960cf90cbe0d2b743c471d24a3d5d6db6002af5eebb02204d70ec490fd0f7055a7c45f86514336e3a7f03503dacecabb247fc23f15c83510100ffffffff010000000000000000016a00000000", "P2SH"],
122122

123+
["CHECKLOCKTIMEVERIFY tests"],
124+
125+
["By-height locks, with argument just beyond tx nLockTime"],
126+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1 NOP2 1"]],
127+
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
128+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 NOP2 1"]],
129+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000fe64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"],
130+
131+
["By-time locks, with argument just beyond tx nLockTime (but within numerical boundries)"],
132+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000001 NOP2 1"]],
133+
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"],
134+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 NOP2 1"]],
135+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000feffffff", "P2SH,CHECKLOCKTIMEVERIFY"],
136+
137+
["Argument missing"],
138+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "NOP2 1"]],
139+
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
140+
141+
["Argument negative with by-blockheight nLockTime=0"],
142+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 NOP2 1"]],
143+
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
144+
145+
["Argument negative with by-blocktime nLockTime=500,000,000"],
146+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 NOP2 1"]],
147+
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"],
148+
149+
["Input locked"],
150+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]],
151+
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
152+
153+
["Another input being unlocked isn't sufficient; the CHECKLOCKTIMEVERIFY-using input must be unlocked"],
154+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"] ,
155+
["0000000000000000000000000000000000000000000000000000000000000200", 1, "1"]],
156+
"010000000200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00020000000000000000000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
157+
158+
["Argument/tx height/time mismatch, both versions"],
159+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]],
160+
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"],
161+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 NOP2 1"]],
162+
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"],
163+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]],
164+
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
165+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]],
166+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"],
167+
168+
["Argument 2^32 with nLockTime=2^32-1"],
169+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967296 NOP2 1"]],
170+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "P2SH,CHECKLOCKTIMEVERIFY"],
171+
172+
["Same, but with nLockTime=2^31-1"],
173+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483648 NOP2 1"]],
174+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffff7f", "P2SH,CHECKLOCKTIMEVERIFY"],
175+
176+
["6 byte non-minimally-encoded arguments are invalid even in their contents are valid"],
177+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x06 0x000000000000 NOP2 1"]],
178+
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
179+
180+
["Failure due to failing CHECKLOCKTIMEVERIFY in scriptSig"],
181+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]],
182+
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b1000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
183+
184+
["Failure due to failing CHECKLOCKTIMEVERIFY in redeemScript"],
185+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xc5b93064159b3b2d6ab506a41b1f50463771b988 EQUAL"]],
186+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000030251b1000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
123187

124188
["Make diffs cleaner by leaving a comment here without comma at the end"]
125189
]

Diff for: src/test/data/tx_valid.json

+42
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,47 @@
187187
"0100000002dbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce000000006b4830450221009627444320dc5ef8d7f68f35010b4c050a6ed0d96b67a84db99fda9c9de58b1e02203e4b4aaa019e012e65d69b487fdf8719df72f488fa91506a80c49a33929f1fd50121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffffdbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce010000009300483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303ffffffff01a0860100000000001976a9149bc0bbdd3024da4d0c38ed1aecf5c68dd1d3fa1288ac00000000", "P2SH"],
188188

189189

190+
["CHECKLOCKTIMEVERIFY tests"],
191+
192+
["By-height locks, with argument == 0 and == tx nLockTime"],
193+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]],
194+
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
195+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 NOP2 1"]],
196+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"],
197+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]],
198+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"],
199+
200+
["By-time locks, with argument just beyond tx nLockTime (but within numerical boundries)"],
201+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]],
202+
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"],
203+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 NOP2 1"]],
204+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "P2SH,CHECKLOCKTIMEVERIFY"],
205+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]],
206+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "P2SH,CHECKLOCKTIMEVERIFY"],
207+
208+
["Any non-maxint nSequence is fine"],
209+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]],
210+
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000feffffff0100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
211+
212+
["The argument can be calculated rather than created directly by a PUSHDATA"],
213+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 1ADD NOP2 1"]],
214+
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"],
215+
216+
["Perhaps even by an ADD producing a 5-byte result that is out of bounds for other opcodes"],
217+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483647 2147483647 ADD NOP2 1"]],
218+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000feffffff", "P2SH,CHECKLOCKTIMEVERIFY"],
219+
220+
["5 byte non-minimally-encoded arguments are valid"],
221+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x05 0x0000000000 NOP2 1"]],
222+
"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"],
223+
224+
["Valid CHECKLOCKTIMEVERIFY in scriptSig"],
225+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]],
226+
"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b1000000000100000000000000000001000000", "P2SH,CHECKLOCKTIMEVERIFY"],
227+
228+
["Valid CHECKLOCKTIMEVERIFY in redeemScript"],
229+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0xc5b93064159b3b2d6ab506a41b1f50463771b988 EQUAL"]],
230+
"0100000001000100000000000000000000000000000000000000000000000000000000000000000000030251b1000000000100000000000000000001000000", "P2SH,CHECKLOCKTIMEVERIFY"],
231+
190232
["Make diffs cleaner by leaving a comment here without comma at the end"]
191233
]

Diff for: src/test/scriptnum_tests.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static void RunCreate(const int64_t& num)
145145
{
146146
CheckCreateInt(num);
147147
CScriptNum scriptnum(num);
148-
if (scriptnum.getvch().size() <= CScriptNum::nMaxNumSize)
148+
if (scriptnum.getvch().size() <= CScriptNum::nDefaultMaxNumSize)
149149
CheckCreateVch(num);
150150
else
151151
{

0 commit comments

Comments
 (0)