Commit 757b7f4 1 parent bd2fed3 commit 757b7f4 Copy full SHA for 757b7f4
File tree 1 file changed +19
-7
lines changed
1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change 23
23
24
24
typedef std::vector<unsigned char > valtype;
25
25
26
- class CCoins ;
27
26
class CTransaction ;
28
27
29
28
static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520 ; // bytes
42
41
enum
43
42
{
44
43
SCRIPT_VERIFY_NONE = 0 ,
45
- SCRIPT_VERIFY_P2SH = (1U << 0 ),
46
- SCRIPT_VERIFY_NOCACHE = (1U << 1 ), // do not store results in signature cache (but do query it)
44
+ SCRIPT_VERIFY_NOCACHE = (1U << 0 ), // do not store results in signature cache (but do query it)
47
45
SCRIPT_VERIFY_NULLDUMMY = (1U << 1 ), // verify dummy stack item consumed by CHECKMULTISIG is of zero-length
48
46
};
49
47
@@ -462,20 +460,34 @@ class CScriptNum
462
460
class CScript : public std ::vector<unsigned char >
463
461
{
464
462
protected:
465
- CScript& push_int64 (int64_t n)
463
+ CScript& push_int64 (int64 n)
466
464
{
467
465
if (n == -1 || (n >= 1 && n <= 16 ))
468
466
{
469
467
push_back (n + (OP_1 - 1 ));
470
468
}
471
- else if (n == 0 )
469
+ else
472
470
{
473
- push_back (OP_0);
471
+ CBigNum bn (n);
472
+ *this << bn.getvch ();
473
+ }
474
+ return *this ;
475
+ }
476
+
477
+ CScript& push_uint64 (uint64 n)
478
+ {
479
+ if (n >= 1 && n <= 16 )
480
+ {
481
+ push_back (n + (OP_1 - 1 ));
474
482
}
475
483
else
476
484
{
477
- *this << CScriptNum::serialize (n);
485
+ CBigNum bn (n);
486
+ *this << bn.getvch ();
478
487
}
488
+ return *this ;
489
+ }
490
+
479
491
public:
480
492
CScript () { }
481
493
CScript (const CScript& b) : std::vector<unsigned char >(b.begin(), b.end()) { }
You can’t perform that action at this time.
0 commit comments