Skip to content

Commit 698c6ab

Browse files
committed
Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4)
Also use the new flag as a standard rule, and replace the IsCanonicalPush standardness check with it (as it is more complete).
1 parent d752ba8 commit 698c6ab

File tree

11 files changed

+101
-59
lines changed

11 files changed

+101
-59
lines changed

src/main.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,6 @@ bool IsStandardTx(const CTransaction& tx, string& reason)
633633
reason = "scriptsig-not-pushonly";
634634
return false;
635635
}
636-
if (!txin.scriptSig.HasCanonicalPushes()) {
637-
reason = "scriptsig-non-canonical-push";
638-
return false;
639-
}
640636
}
641637

642638
unsigned int nDataOut = 0;

src/script/interpreter.cpp

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,29 @@ bool static CheckPubKeyEncoding(const valtype &vchSig, unsigned int flags) {
157157
return true;
158158
}
159159

160+
bool static CheckMinimalPush(const valtype& data, opcodetype opcode) {
161+
if (data.size() == 0) {
162+
// Could have used OP_0.
163+
return opcode == OP_0;
164+
} else if (data.size() == 1 && data[0] >= 1 && data[0] <= 16) {
165+
// Could have used OP_1 .. OP_16.
166+
return opcode == OP_1 + (data[0] - 1);
167+
} else if (data.size() == 1 && data[0] == 0x81) {
168+
// Could have used OP_1NEGATE.
169+
return opcode == OP_1NEGATE;
170+
} else if (data.size() <= 75) {
171+
// Could have used a direct push (opcode indicating number of bytes pushed + those bytes).
172+
return opcode == data.size();
173+
} else if (data.size() <= 255) {
174+
// Could have used OP_PUSHDATA.
175+
return opcode == OP_PUSHDATA1;
176+
} else if (data.size() <= 65535) {
177+
// Could have used OP_PUSHDATA2.
178+
return opcode == OP_PUSHDATA2;
179+
}
180+
return true;
181+
}
182+
160183
bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker)
161184
{
162185
CScript::const_iterator pc = script.begin();
@@ -169,6 +192,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
169192
if (script.size() > 10000)
170193
return false;
171194
int nOpCount = 0;
195+
bool fRequireMinimal = (flags & SCRIPT_VERIFY_MINIMALDATA) != 0;
172196

173197
try
174198
{
@@ -205,9 +229,12 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
205229
opcode == OP_RSHIFT)
206230
return false; // Disabled opcodes.
207231

208-
if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4)
232+
if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4) {
233+
if (fRequireMinimal && !CheckMinimalPush(vchPushValue, opcode)) {
234+
return false;
235+
}
209236
stack.push_back(vchPushValue);
210-
else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF))
237+
} else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF))
211238
switch (opcode)
212239
{
213240
//
@@ -234,6 +261,8 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
234261
// ( -- value)
235262
CScriptNum bn((int)opcode - (int)(OP_1 - 1));
236263
stack.push_back(bn.getvch());
264+
// The result of these opcodes should always be the minimal way to push the data
265+
// they push, so no need for a CheckMinimalPush here.
237266
}
238267
break;
239268

@@ -458,7 +487,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
458487
// (xn ... x2 x1 x0 n - ... x2 x1 x0 xn)
459488
if (stack.size() < 2)
460489
return false;
461-
int n = CScriptNum(stacktop(-1)).getint();
490+
int n = CScriptNum(stacktop(-1), fRequireMinimal).getint();
462491
popstack(stack);
463492
if (n < 0 || n >= (int)stack.size())
464493
return false;
@@ -557,7 +586,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
557586
// (in -- out)
558587
if (stack.size() < 1)
559588
return false;
560-
CScriptNum bn(stacktop(-1));
589+
CScriptNum bn(stacktop(-1), fRequireMinimal);
561590
switch (opcode)
562591
{
563592
case OP_1ADD: bn += bnOne; break;
@@ -590,8 +619,8 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
590619
// (x1 x2 -- out)
591620
if (stack.size() < 2)
592621
return false;
593-
CScriptNum bn1(stacktop(-2));
594-
CScriptNum bn2(stacktop(-1));
622+
CScriptNum bn1(stacktop(-2), fRequireMinimal);
623+
CScriptNum bn2(stacktop(-1), fRequireMinimal);
595624
CScriptNum bn(0);
596625
switch (opcode)
597626
{
@@ -635,9 +664,9 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
635664
// (x min max -- out)
636665
if (stack.size() < 3)
637666
return false;
638-
CScriptNum bn1(stacktop(-3));
639-
CScriptNum bn2(stacktop(-2));
640-
CScriptNum bn3(stacktop(-1));
667+
CScriptNum bn1(stacktop(-3), fRequireMinimal);
668+
CScriptNum bn2(stacktop(-2), fRequireMinimal);
669+
CScriptNum bn3(stacktop(-1), fRequireMinimal);
641670
bool fValue = (bn2 <= bn1 && bn1 < bn3);
642671
popstack(stack);
643672
popstack(stack);
@@ -727,7 +756,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
727756
if ((int)stack.size() < i)
728757
return false;
729758

730-
int nKeysCount = CScriptNum(stacktop(-i)).getint();
759+
int nKeysCount = CScriptNum(stacktop(-i), fRequireMinimal).getint();
731760
if (nKeysCount < 0 || nKeysCount > 20)
732761
return false;
733762
nOpCount += nKeysCount;
@@ -738,7 +767,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
738767
if ((int)stack.size() < i)
739768
return false;
740769

741-
int nSigsCount = CScriptNum(stacktop(-i)).getint();
770+
int nSigsCount = CScriptNum(stacktop(-i), fRequireMinimal).getint();
742771
if (nSigsCount < 0 || nSigsCount > nKeysCount)
743772
return false;
744773
int isig = ++i;

src/script/interpreter.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ enum
4949

5050
// Using a non-push operator in the scriptSig causes script failure (softfork safe, BIP62 rule 2).
5151
SCRIPT_VERIFY_SIGPUSHONLY = (1U << 5),
52+
53+
// Require minimal encodings for all push operations (OP_0... OP_16, OP_1NEGATE where possible, direct
54+
// pushes up to 75 bytes, OP_PUSHDATA up to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating
55+
// any other push causes the script to fail (BIP62 rule 3).
56+
// In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4).
57+
// (softfork safe)
58+
SCRIPT_VERIFY_MINIMALDATA = (1U << 6)
5259
};
5360

5461
uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType);

src/script/script.cpp

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace {
1212
inline std::string ValueString(const std::vector<unsigned char>& vch)
1313
{
1414
if (vch.size() <= 4)
15-
return strprintf("%d", CScriptNum(vch).getint());
15+
return strprintf("%d", CScriptNum(vch, false).getint());
1616
else
1717
return HexStr(vch);
1818
}
@@ -238,33 +238,6 @@ bool CScript::IsPushOnly() const
238238
return true;
239239
}
240240

241-
bool CScript::HasCanonicalPushes() const
242-
{
243-
const_iterator pc = begin();
244-
while (pc < end())
245-
{
246-
opcodetype opcode;
247-
std::vector<unsigned char> data;
248-
if (!GetOp(pc, opcode, data))
249-
return false;
250-
if (opcode > OP_16)
251-
continue;
252-
if (opcode < OP_PUSHDATA1 && opcode > OP_0 && (data.size() == 1 && data[0] <= 16))
253-
// Could have used an OP_n code, rather than a 1-byte push.
254-
return false;
255-
if (opcode == OP_PUSHDATA1 && data.size() < OP_PUSHDATA1)
256-
// Could have used a normal n-byte push, rather than OP_PUSHDATA1.
257-
return false;
258-
if (opcode == OP_PUSHDATA2 && data.size() <= 0xFF)
259-
// Could have used an OP_PUSHDATA1.
260-
return false;
261-
if (opcode == OP_PUSHDATA4 && data.size() <= 0xFFFF)
262-
// Could have used an OP_PUSHDATA2.
263-
return false;
264-
}
265-
return true;
266-
}
267-
268241
std::string CScript::ToString() const
269242
{
270243
std::string str;

src/script/script.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,14 @@ class CScriptNum
192192
m_value = n;
193193
}
194194

195-
explicit CScriptNum(const std::vector<unsigned char>& vch)
195+
explicit CScriptNum(const std::vector<unsigned char>& vch, bool fRequireMinimal)
196196
{
197-
if (vch.size() > nMaxNumSize)
198-
throw scriptnum_error("CScriptNum(const std::vector<unsigned char>&) : overflow");
197+
if (vch.size() > nMaxNumSize) {
198+
throw scriptnum_error("script number overflow");
199+
}
200+
if (fRequireMinimal && vch.size() > 0 && (vch.back() & 0x7f) == 0 && (vch.size() <= 1 || (vch[vch.size() - 2] & 0x80) == 0)) {
201+
throw scriptnum_error("non-minimally encoded script number");
202+
}
199203
m_value = set_vch(vch);
200204
}
201205

@@ -319,7 +323,6 @@ class CScriptNum
319323
int64_t m_value;
320324
};
321325

322-
323326
/** Serialized script, used inside transaction inputs and outputs */
324327
class CScript : public std::vector<unsigned char>
325328
{
@@ -330,6 +333,10 @@ class CScript : public std::vector<unsigned char>
330333
{
331334
push_back(n + (OP_1 - 1));
332335
}
336+
else if (n == 0)
337+
{
338+
push_back(OP_0);
339+
}
333340
else
334341
{
335342
*this << CScriptNum::serialize(n);
@@ -554,9 +561,6 @@ class CScript : public std::vector<unsigned char>
554561
// Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical).
555562
bool IsPushOnly() const;
556563

557-
// Called by IsStandardTx.
558-
bool HasCanonicalPushes() const;
559-
560564
// Returns whether the script is guaranteed to fail at execution,
561565
// regardless of the initial stack. This allows outputs to be pruned
562566
// instantly when entering the UTXO set.

src/script/standard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH;
4141
// blocks and we must accept those blocks.
4242
static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS |
4343
SCRIPT_VERIFY_STRICTENC |
44+
SCRIPT_VERIFY_MINIMALDATA |
4445
SCRIPT_VERIFY_NULLDUMMY;
4546

4647
// For convenience, standard but not mandatory verify flags.

src/test/data/script_invalid.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ nSequences are max.
384384

385385
["0x00", "'00' EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"],
386386

387+
["1 IF 0x01 0x81 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"],
388+
["1 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"],
389+
["1 IF 0x4c 0x03 0x222222 ENDIF 1", "", "MINIMALDATA", "evaluated non-minimal data"],
390+
387391
[
388392
"0x47 0x30440220304eff7556bba9560df47873275e64db45f3cd735998ce3f00d2e57b1bb5f31302205c0c9d14b8b80d43e2ac9b87532f1af6d8a3271262bc694ec4e14068392bb0a001",
389393
"0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG",

src/test/data/script_valid.json

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,33 @@ nSequences are max.
529529

530530
["0x00", "SIZE 0 EQUAL", "P2SH,STRICTENC", "Basic OP_0 execution"],
531531

532+
["0x01 0x81", "0x4f EQUAL", "", "direct push of 0x81 equals 1NEGATE"],
533+
["0x01 0x05", "5 EQUAL", "", "direct push of 0x05 equals 5"],
534+
["0x4c 0x4b 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "0x4b 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 EQUAL", "", "PUSHDATA1 of 75 bytes equals direct push of it"],
535+
["0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", "0x4c 0xFF 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 EQUAL", "", "PUSHDATA2 of 255 bytes equals PUSHDATA1 of it"],
536+
["0x02 0x8000", "128 NUMEQUAL", "", "0x8000 equals 128"],
537+
["0x01 0x00", "0 NUMEQUAL", "", "0x00 numequals 0"],
538+
["0x01 0x80", "0 NUMEQUAL", "", "0x80 (negative zero) numequals 0"],
539+
["0x02 0x0080", "0 NUMEQUAL", "", "0x0080 numequals 0"],
540+
["0x02 0x0500", "5 NUMEQUAL", "", "0x0500 numequals 5"],
541+
["0x03 0xff7f80", "0x02 0xffff NUMEQUAL", "", ""],
542+
["0x03 0xff7f00", "0x02 0xff7f NUMEQUAL", "", ""],
543+
["0x04 0xffff7f80", "0x03 0xffffff NUMEQUAL", "", ""],
544+
["0x04 0xffff7f00", "0x03 0xffff7f NUMEQUAL", "", ""],
545+
["0 IF 0x01 0x81 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
546+
["0 IF 0x01 0x05 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
547+
["0 IF 0x02 0x8000 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
548+
["0 IF 0x01 0x00 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
549+
["0 IF 0x01 0x80 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
550+
["0 IF 0x02 0x0080 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
551+
["0 IF 0x02 0x0400 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
552+
["0 IF 0x03 0xff7f80 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
553+
["0 IF 0x03 0xff7f00 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
554+
["0 IF 0x04 0xffff7f80 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
555+
["0 IF 0x04 0xffff7f00 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
556+
["0 IF 0x4c 0x03 0x222222 ENDIF 1", "", "MINIMALDATA", "unevaluated non-minimal data"],
557+
558+
532559
[
533560
"0x47 0x3044022007415aa37ce7eaa6146001ac8bdefca0ddcba0e37c5dc08c4ac99392124ebac802207d382307fd53f65778b07b9c63b6e196edeadf0be719130c5db21ff1e700d67501",
534561
"0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG",
@@ -638,13 +665,13 @@ nSequences are max.
638665
"P2PK NOT with invalid sig and undefined hashtype but no STRICTENC"
639666
],
640667
[
641-
"0x01 0x01 0x47 0x3044022046ce33d1771b0127dd4c4cef8fdc3218ebdfa60e3793ed700292d8ebd93fb1f402201029d47a414db83e96e31443c2d8b552f971469c4800f5eff7df2f0648521aed01 0x47 0x304402205c53911ad55b054920043962bbda98cf6e57e2db1cd5611138251490baabaa8702201dc80dfceae6007e7772dc13ff6e7ca66a983cb017fe5d46d30118462d83bcf801 0x47 0x304402201937e44a4ec12364f9d32f9d25e7ecbc68aee9ef90069af80efef4c05f6ace9602206c515101c00c75710b32ff7ff8dbaf7c9a0be6e86ed14a0755b47626604f31fd01",
668+
"1 0x47 0x3044022046ce33d1771b0127dd4c4cef8fdc3218ebdfa60e3793ed700292d8ebd93fb1f402201029d47a414db83e96e31443c2d8b552f971469c4800f5eff7df2f0648521aed01 0x47 0x304402205c53911ad55b054920043962bbda98cf6e57e2db1cd5611138251490baabaa8702201dc80dfceae6007e7772dc13ff6e7ca66a983cb017fe5d46d30118462d83bcf801 0x47 0x304402201937e44a4ec12364f9d32f9d25e7ecbc68aee9ef90069af80efef4c05f6ace9602206c515101c00c75710b32ff7ff8dbaf7c9a0be6e86ed14a0755b47626604f31fd01",
642669
"3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG",
643670
"",
644671
"3-of-3 with nonzero dummy but no NULLDUMMY"
645672
],
646673
[
647-
"0x01 0x01 0x47 0x30440220195038dbc6b2ae1199f86a6777824f7c5149789d85f655a3534a4422b8fba38c02204df9db87d2eb9fe06edc66870d9ac4c9ce673459f9d43cee0347ce4ffb02ee5a01 0x47 0x3044022010a45f30c6fa97a186eba9e6b595ab87d3dfcbf05dcaf1f1b8e3e7bf39515bb802203474e78d3d372e5f5c0f8c257ce8300c4bb8f37c51d4a894e11a91b5817da6ed01 0x47 0x30440220039cffd8e39850f95112662b1220b14b3c0d3d8a2772e13c947bfbf96345a64e02204154bfa77e2c0134d5434353bed82141e5da1cc479954aa288d5f0671480a04b01",
674+
"1 0x47 0x30440220195038dbc6b2ae1199f86a6777824f7c5149789d85f655a3534a4422b8fba38c02204df9db87d2eb9fe06edc66870d9ac4c9ce673459f9d43cee0347ce4ffb02ee5a01 0x47 0x3044022010a45f30c6fa97a186eba9e6b595ab87d3dfcbf05dcaf1f1b8e3e7bf39515bb802203474e78d3d372e5f5c0f8c257ce8300c4bb8f37c51d4a894e11a91b5817da6ed01 0x47 0x30440220039cffd8e39850f95112662b1220b14b3c0d3d8a2772e13c947bfbf96345a64e02204154bfa77e2c0134d5434353bed82141e5da1cc479954aa288d5f0671480a04b01",
648675
"3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT",
649676
"",
650677
"3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY"

src/test/script_tests.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class TestBuilder
179179
TestBuilder& Num(int num)
180180
{
181181
DoPush();
182-
spendTx.vin[0].scriptSig << CScriptNum(num);
182+
spendTx.vin[0].scriptSig << num;
183183
return *this;
184184
}
185185

@@ -788,19 +788,19 @@ BOOST_AUTO_TEST_CASE(script_combineSigs)
788788

789789
BOOST_AUTO_TEST_CASE(script_standard_push)
790790
{
791-
for (int i=0; i<1000; i++) {
791+
for (int i=0; i<67000; i++) {
792792
CScript script;
793793
script << i;
794794
BOOST_CHECK_MESSAGE(script.IsPushOnly(), "Number " << i << " is not pure push.");
795-
BOOST_CHECK_MESSAGE(script.HasCanonicalPushes(), "Number " << i << " push is not canonical.");
795+
BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker()), "Number " << i << " push is not minimal data.");
796796
}
797797

798-
for (int i=0; i<1000; i++) {
798+
for (unsigned int i=0; i<=MAX_SCRIPT_ELEMENT_SIZE; i++) {
799799
std::vector<unsigned char> data(i, '\111');
800800
CScript script;
801801
script << data;
802802
BOOST_CHECK_MESSAGE(script.IsPushOnly(), "Length " << i << " is not pure push.");
803-
BOOST_CHECK_MESSAGE(script.HasCanonicalPushes(), "Length " << i << " push is not canonical.");
803+
BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker()), "Length " << i << " push is not minimal data.");
804804
}
805805
}
806806

src/test/scriptnum_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ static void CheckCreateVch(const int64_t& num)
2525
BOOST_CHECK(verify(bignum, scriptnum));
2626

2727
CBigNum bignum2(bignum.getvch());
28-
CScriptNum scriptnum2(scriptnum.getvch());
28+
CScriptNum scriptnum2(scriptnum.getvch(), false);
2929
BOOST_CHECK(verify(bignum2, scriptnum2));
3030

3131
CBigNum bignum3(scriptnum2.getvch());
32-
CScriptNum scriptnum3(bignum2.getvch());
32+
CScriptNum scriptnum3(bignum2.getvch(), false);
3333
BOOST_CHECK(verify(bignum3, scriptnum3));
3434
}
3535

0 commit comments

Comments
 (0)