|
1 |
| -// Copyright (c) 2009-2022 Satoshi Nakamoto |
2 |
| -// Copyright (c) 2009-2022 The Bitcoin developers |
| 1 | +// Copyright (c) 2009-2024 Satoshi Nakamoto |
| 2 | +// Copyright (c) 2009-2024 The Bitcoin developers |
| 3 | +// Copyright (c) 2009-2024 The Litedoge developers |
3 | 4 | // Distributed under the MIT/X11 software license, see the accompanying
|
4 | 5 | // file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
5 | 6 |
|
|
22 | 23 |
|
23 | 24 | typedef std::vector<unsigned char> valtype;
|
24 | 25 |
|
| 26 | +class CCoins; |
25 | 27 | class CTransaction;
|
26 | 28 |
|
27 | 29 | static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes
|
|
40 | 42 | enum
|
41 | 43 | {
|
42 | 44 | SCRIPT_VERIFY_NONE = 0,
|
43 |
| - SCRIPT_VERIFY_NOCACHE = (1U << 0), // do not store results in signature cache (but do query it) |
| 45 | + SCRIPT_VERIFY_P2SH = (1U << 0), |
| 46 | + SCRIPT_VERIFY_NOCACHE = (1U << 1), // do not store results in signature cache (but do query it) |
44 | 47 | SCRIPT_VERIFY_NULLDUMMY = (1U << 1), // verify dummy stack item consumed by CHECKMULTISIG is of zero-length
|
| 48 | +}; |
45 | 49 |
|
46 | 50 | // Discourage use of NOPs reserved for upgrades (NOP1-10)
|
47 | 51 | //
|
@@ -458,32 +462,20 @@ class CScriptNum
|
458 | 462 | class CScript : public std::vector<unsigned char>
|
459 | 463 | {
|
460 | 464 | protected:
|
461 |
| - CScript& push_int64(int64_t n) |
| 465 | + CScript& push_int64(int64_t n) |
462 | 466 | {
|
463 | 467 | if (n == -1 || (n >= 1 && n <= 16))
|
464 | 468 | {
|
465 | 469 | push_back(n + (OP_1 - 1));
|
466 | 470 | }
|
467 |
| - else |
468 |
| - { |
469 |
| - *this << CScriptNum::serialize(n); |
470 |
| - } |
471 |
| - return *this; |
472 |
| - } |
473 |
| - |
474 |
| - CScript& push_uint64(uint64_t n) |
475 |
| - { |
476 |
| - if (n >= 1 && n <= 16) |
| 471 | + else if (n == 0) |
477 | 472 | {
|
478 |
| - push_back(n + (OP_1 - 1)); |
| 473 | + push_back(OP_0); |
479 | 474 | }
|
480 | 475 | else
|
481 | 476 | {
|
482 |
| - *this << CScriptNum::serialize(n); |
| 477 | + *this << CScriptNum::serialize(n); |
483 | 478 | }
|
484 |
| - return *this; |
485 |
| - } |
486 |
| - |
487 | 479 | public:
|
488 | 480 | CScript() { }
|
489 | 481 | CScript(const CScript& b) : std::vector<unsigned char>(b.begin(), b.end()) { }
|
@@ -535,6 +527,7 @@ class CScript : public std::vector<unsigned char>
|
535 | 527 | CScript& operator<<(unsigned short b) { return push_uint64(b); }
|
536 | 528 | CScript& operator<<(unsigned long b) { return push_uint64(b); }
|
537 | 529 | CScript& operator<<(unsigned long long b) { return push_uint64(b); }
|
| 530 | + CScript& operator<<(uint64 b) { return push_uint64(b); } |
538 | 531 |
|
539 | 532 | CScript& operator<<(opcodetype opcode)
|
540 | 533 | {
|
|
0 commit comments