Bitcoin ABC  0.22.12
P2P Digital Currency
script.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_SCRIPT_SCRIPT_H
7 #define BITCOIN_SCRIPT_SCRIPT_H
8 
9 #include <crypto/common.h>
10 #include <prevector.h>
11 #include <serialize.h>
12 
13 #include <cassert>
14 #include <climits>
15 #include <cstdint>
16 #include <cstring>
17 #include <limits>
18 #include <stdexcept>
19 #include <string>
20 #include <vector>
21 
22 // Maximum number of bytes pushable to the stack
23 static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520;
24 
25 // Maximum number of non-push operations per script
26 static const int MAX_OPS_PER_SCRIPT = 201;
27 
28 // Maximum number of public keys per multisig
29 static const int MAX_PUBKEYS_PER_MULTISIG = 20;
30 
31 // Maximum script length in bytes
32 static const int MAX_SCRIPT_SIZE = 10000;
33 
34 // Maximum number of values on script interpreter stack
35 static const int MAX_STACK_SIZE = 1000;
36 
37 // Threshold for nLockTime: below this value it is interpreted as block number,
38 // otherwise as UNIX timestamp. Thresold is Tue Nov 5 00:53:20 1985 UTC
39 static const unsigned int LOCKTIME_THRESHOLD = 500000000;
40 
41 template <typename T> std::vector<uint8_t> ToByteVector(const T &in) {
42  return std::vector<uint8_t>(in.begin(), in.end());
43 }
44 
46 enum opcodetype {
47  // push value
48  OP_0 = 0x00,
50  OP_PUSHDATA1 = 0x4c,
51  OP_PUSHDATA2 = 0x4d,
52  OP_PUSHDATA4 = 0x4e,
53  OP_1NEGATE = 0x4f,
54  OP_RESERVED = 0x50,
55  OP_1 = 0x51,
57  OP_2 = 0x52,
58  OP_3 = 0x53,
59  OP_4 = 0x54,
60  OP_5 = 0x55,
61  OP_6 = 0x56,
62  OP_7 = 0x57,
63  OP_8 = 0x58,
64  OP_9 = 0x59,
65  OP_10 = 0x5a,
66  OP_11 = 0x5b,
67  OP_12 = 0x5c,
68  OP_13 = 0x5d,
69  OP_14 = 0x5e,
70  OP_15 = 0x5f,
71  OP_16 = 0x60,
72 
73  // control
74  OP_NOP = 0x61,
75  OP_VER = 0x62,
76  OP_IF = 0x63,
77  OP_NOTIF = 0x64,
78  OP_VERIF = 0x65,
79  OP_VERNOTIF = 0x66,
80  OP_ELSE = 0x67,
81  OP_ENDIF = 0x68,
82  OP_VERIFY = 0x69,
83  OP_RETURN = 0x6a,
84 
85  // stack ops
86  OP_TOALTSTACK = 0x6b,
88  OP_2DROP = 0x6d,
89  OP_2DUP = 0x6e,
90  OP_3DUP = 0x6f,
91  OP_2OVER = 0x70,
92  OP_2ROT = 0x71,
93  OP_2SWAP = 0x72,
94  OP_IFDUP = 0x73,
95  OP_DEPTH = 0x74,
96  OP_DROP = 0x75,
97  OP_DUP = 0x76,
98  OP_NIP = 0x77,
99  OP_OVER = 0x78,
100  OP_PICK = 0x79,
101  OP_ROLL = 0x7a,
102  OP_ROT = 0x7b,
103  OP_SWAP = 0x7c,
104  OP_TUCK = 0x7d,
105 
106  // splice ops
107  OP_CAT = 0x7e,
108  OP_SPLIT = 0x7f, // after monolith upgrade (May 2018)
109  OP_NUM2BIN = 0x80, // after monolith upgrade (May 2018)
110  OP_BIN2NUM = 0x81, // after monolith upgrade (May 2018)
111  OP_SIZE = 0x82,
112 
113  // bit logic
114  OP_INVERT = 0x83,
115  OP_AND = 0x84,
116  OP_OR = 0x85,
117  OP_XOR = 0x86,
118  OP_EQUAL = 0x87,
120  OP_RESERVED1 = 0x89,
121  OP_RESERVED2 = 0x8a,
122 
123  // numeric
124  OP_1ADD = 0x8b,
125  OP_1SUB = 0x8c,
126  OP_2MUL = 0x8d,
127  OP_2DIV = 0x8e,
128  OP_NEGATE = 0x8f,
129  OP_ABS = 0x90,
130  OP_NOT = 0x91,
131  OP_0NOTEQUAL = 0x92,
132 
133  OP_ADD = 0x93,
134  OP_SUB = 0x94,
135  OP_MUL = 0x95,
136  OP_DIV = 0x96,
137  OP_MOD = 0x97,
138  OP_LSHIFT = 0x98,
139  OP_RSHIFT = 0x99,
140 
141  OP_BOOLAND = 0x9a,
142  OP_BOOLOR = 0x9b,
143  OP_NUMEQUAL = 0x9c,
146  OP_LESSTHAN = 0x9f,
150  OP_MIN = 0xa3,
151  OP_MAX = 0xa4,
152 
153  OP_WITHIN = 0xa5,
154 
155  // crypto
156  OP_RIPEMD160 = 0xa6,
157  OP_SHA1 = 0xa7,
158  OP_SHA256 = 0xa8,
159  OP_HASH160 = 0xa9,
160  OP_HASH256 = 0xaa,
162  OP_CHECKSIG = 0xac,
166 
167  // expansion
168  OP_NOP1 = 0xb0,
173  OP_NOP4 = 0xb3,
174  OP_NOP5 = 0xb4,
175  OP_NOP6 = 0xb5,
176  OP_NOP7 = 0xb6,
177  OP_NOP8 = 0xb7,
178  OP_NOP9 = 0xb8,
179  OP_NOP10 = 0xb9,
180 
181  // More crypto
184 
185  // additional byte string operations
187 
188  // The first op_code value after all defined opcodes
190 
191  // multi-byte opcodes
194 
196 };
197 
198 // Maximum value that an opcode can be
199 static const unsigned int MAX_OPCODE = FIRST_UNDEFINED_OP_VALUE - 1;
200 
201 const char *GetOpName(opcodetype opcode);
202 
207 bool CheckMinimalPush(const std::vector<uint8_t> &data, opcodetype opcode);
208 
209 class scriptnum_error : public std::runtime_error {
210 public:
211  explicit scriptnum_error(const std::string &str)
212  : std::runtime_error(str) {}
213 };
214 
215 class CScriptNum {
225 public:
226  static const size_t MAXIMUM_ELEMENT_SIZE = 4;
227 
228  explicit CScriptNum(const int64_t &n) { m_value = n; }
229 
230  explicit CScriptNum(const std::vector<uint8_t> &vch, bool fRequireMinimal,
231  const size_t nMaxNumSize = MAXIMUM_ELEMENT_SIZE) {
232  if (vch.size() > nMaxNumSize) {
233  throw scriptnum_error("script number overflow");
234  }
235  if (fRequireMinimal && !IsMinimallyEncoded(vch, nMaxNumSize)) {
236  throw scriptnum_error("non-minimally encoded script number");
237  }
238  m_value = set_vch(vch);
239  }
240 
241  static bool IsMinimallyEncoded(
242  const std::vector<uint8_t> &vch,
243  const size_t nMaxNumSize = CScriptNum::MAXIMUM_ELEMENT_SIZE);
244 
245  static bool MinimallyEncode(std::vector<uint8_t> &data);
246 
247  inline bool operator==(const int64_t &rhs) const { return m_value == rhs; }
248  inline bool operator!=(const int64_t &rhs) const { return m_value != rhs; }
249  inline bool operator<=(const int64_t &rhs) const { return m_value <= rhs; }
250  inline bool operator<(const int64_t &rhs) const { return m_value < rhs; }
251  inline bool operator>=(const int64_t &rhs) const { return m_value >= rhs; }
252  inline bool operator>(const int64_t &rhs) const { return m_value > rhs; }
253 
254  inline bool operator==(const CScriptNum &rhs) const {
255  return operator==(rhs.m_value);
256  }
257  inline bool operator!=(const CScriptNum &rhs) const {
258  return operator!=(rhs.m_value);
259  }
260  inline bool operator<=(const CScriptNum &rhs) const {
261  return operator<=(rhs.m_value);
262  }
263  inline bool operator<(const CScriptNum &rhs) const {
264  return operator<(rhs.m_value);
265  }
266  inline bool operator>=(const CScriptNum &rhs) const {
267  return operator>=(rhs.m_value);
268  }
269  inline bool operator>(const CScriptNum &rhs) const {
270  return operator>(rhs.m_value);
271  }
272 
273  inline CScriptNum operator+(const int64_t &rhs) const {
274  return CScriptNum(m_value + rhs);
275  }
276  inline CScriptNum operator-(const int64_t &rhs) const {
277  return CScriptNum(m_value - rhs);
278  }
279  inline CScriptNum operator+(const CScriptNum &rhs) const {
280  return operator+(rhs.m_value);
281  }
282  inline CScriptNum operator-(const CScriptNum &rhs) const {
283  return operator-(rhs.m_value);
284  }
285 
286  inline CScriptNum operator/(const int64_t &rhs) const {
287  return CScriptNum(m_value / rhs);
288  }
289  inline CScriptNum operator/(const CScriptNum &rhs) const {
290  return operator/(rhs.m_value);
291  }
292 
293  inline CScriptNum operator%(const int64_t &rhs) const {
294  return CScriptNum(m_value % rhs);
295  }
296  inline CScriptNum operator%(const CScriptNum &rhs) const {
297  return operator%(rhs.m_value);
298  }
299 
300  inline CScriptNum &operator+=(const CScriptNum &rhs) {
301  return operator+=(rhs.m_value);
302  }
303  inline CScriptNum &operator-=(const CScriptNum &rhs) {
304  return operator-=(rhs.m_value);
305  }
306 
307  inline CScriptNum operator&(const int64_t &rhs) const {
308  return CScriptNum(m_value & rhs);
309  }
310  inline CScriptNum operator&(const CScriptNum &rhs) const {
311  return operator&(rhs.m_value);
312  }
313 
314  inline CScriptNum &operator&=(const CScriptNum &rhs) {
315  return operator&=(rhs.m_value);
316  }
317 
318  inline CScriptNum operator-() const {
319  assert(m_value != std::numeric_limits<int64_t>::min());
320  return CScriptNum(-m_value);
321  }
322 
323  inline CScriptNum &operator=(const int64_t &rhs) {
324  m_value = rhs;
325  return *this;
326  }
327 
328  inline CScriptNum &operator+=(const int64_t &rhs) {
329  assert(
330  rhs == 0 ||
331  (rhs > 0 && m_value <= std::numeric_limits<int64_t>::max() - rhs) ||
332  (rhs < 0 && m_value >= std::numeric_limits<int64_t>::min() - rhs));
333  m_value += rhs;
334  return *this;
335  }
336 
337  inline CScriptNum &operator-=(const int64_t &rhs) {
338  assert(
339  rhs == 0 ||
340  (rhs > 0 && m_value >= std::numeric_limits<int64_t>::min() + rhs) ||
341  (rhs < 0 && m_value <= std::numeric_limits<int64_t>::max() + rhs));
342  m_value -= rhs;
343  return *this;
344  }
345 
346  inline CScriptNum &operator&=(const int64_t &rhs) {
347  m_value &= rhs;
348  return *this;
349  }
350 
351  int getint() const {
352  if (m_value > std::numeric_limits<int>::max()) {
353  return std::numeric_limits<int>::max();
354  } else if (m_value < std::numeric_limits<int>::min()) {
355  return std::numeric_limits<int>::min();
356  }
357  return m_value;
358  }
359 
360  std::vector<uint8_t> getvch() const { return serialize(m_value); }
361 
362  static std::vector<uint8_t> serialize(const int64_t &value) {
363  if (value == 0) {
364  return {};
365  }
366 
367  std::vector<uint8_t> result;
368  const bool neg = value < 0;
369  uint64_t absvalue = neg ? -value : value;
370 
371  while (absvalue) {
372  result.push_back(absvalue & 0xff);
373  absvalue >>= 8;
374  }
375 
376  // - If the most significant byte is >= 0x80 and the value is positive,
377  // push a new zero-byte to make the significant byte < 0x80 again.
378  // - If the most significant byte is >= 0x80 and the value is negative,
379  // push a new 0x80 byte that will be popped off when converting to an
380  // integral.
381  // - If the most significant byte is < 0x80 and the value is negative,
382  // add 0x80 to it, since it will be subtracted and interpreted as a
383  // negative when converting to an integral.
384  if (result.back() & 0x80) {
385  result.push_back(neg ? 0x80 : 0);
386  } else if (neg) {
387  result.back() |= 0x80;
388  }
389 
390  return result;
391  }
392 
393 private:
394  static int64_t set_vch(const std::vector<uint8_t> &vch) {
395  if (vch.empty()) {
396  return 0;
397  }
398 
399  int64_t result = 0;
400  for (size_t i = 0; i != vch.size(); ++i) {
401  result |= int64_t(vch[i]) << 8 * i;
402  }
403 
404  // If the input vector's most significant byte is 0x80, remove it from
405  // the result's msb and return a negative.
406  if (vch.back() & 0x80) {
407  return -int64_t(result & ~(0x80ULL << (8 * (vch.size() - 1))));
408  }
409 
410  return result;
411  }
412 
413  int64_t m_value;
414 };
415 
423 
425  CScriptBase::const_iterator end, opcodetype &opcodeRet,
426  std::vector<uint8_t> *pvchRet);
427 
429 class CScript : public CScriptBase {
430 protected:
431  CScript &push_int64(int64_t n) {
432  if (n == -1 || (n >= 1 && n <= 16)) {
433  push_back(n + (OP_1 - 1));
434  } else if (n == 0) {
435  push_back(OP_0);
436  } else {
437  *this << CScriptNum::serialize(n);
438  }
439  return *this;
440  }
441 
442 public:
443  CScript() {}
445  : CScriptBase(pbegin, pend) {}
446  CScript(std::vector<uint8_t>::const_iterator pbegin,
447  std::vector<uint8_t>::const_iterator pend)
448  : CScriptBase(pbegin, pend) {}
449  CScript(const uint8_t *pbegin, const uint8_t *pend)
450  : CScriptBase(pbegin, pend) {}
451 
453 
454  template <typename Stream, typename Operation>
455  inline void SerializationOp(Stream &s, Operation ser_action) {
456  READWRITEAS(CScriptBase, *this);
457  }
458 
460  reserve(size() + b.size());
461  insert(end(), b.begin(), b.end());
462  return *this;
463  }
464 
465  friend CScript operator+(const CScript &a, const CScript &b) {
466  CScript ret = a;
467  ret += b;
468  return ret;
469  }
470 
471  CScript(int64_t b) { operator<<(b); }
472 
473  explicit CScript(opcodetype b) { operator<<(b); }
474  explicit CScript(const CScriptNum &b) { operator<<(b); }
475  // delete non-existent constructor to defend against future introduction
476  // e.g. via prevector
477  explicit CScript(const std::vector<uint8_t> &b) = delete;
478 
479  CScript &operator<<(int64_t b) { return push_int64(b); }
480 
482  if (opcode < 0 || opcode > 0xff) {
483  throw std::runtime_error("CScript::operator<<(): invalid opcode");
484  }
485  insert(end(), uint8_t(opcode));
486  return *this;
487  }
488 
490  *this << b.getvch();
491  return *this;
492  }
493 
494  CScript &operator<<(const std::vector<uint8_t> &b) {
495  if (b.size() < OP_PUSHDATA1) {
496  insert(end(), uint8_t(b.size()));
497  } else if (b.size() <= 0xff) {
498  insert(end(), OP_PUSHDATA1);
499  insert(end(), uint8_t(b.size()));
500  } else if (b.size() <= 0xffff) {
501  insert(end(), OP_PUSHDATA2);
502  uint8_t _data[2];
503  WriteLE16(_data, b.size());
504  insert(end(), _data, _data + sizeof(_data));
505  } else {
506  insert(end(), OP_PUSHDATA4);
507  uint8_t _data[4];
508  WriteLE32(_data, b.size());
509  insert(end(), _data, _data + sizeof(_data));
510  }
511  insert(end(), b.begin(), b.end());
512  return *this;
513  }
514 
516  // I'm not sure if this should push the script or concatenate scripts.
517  // If there's ever a use for pushing a script onto a script, delete this
518  // member fn.
519  assert(!"Warning: Pushing a CScript onto a CScript with << is probably "
520  "not intended, use + to concatenate!");
521  return *this;
522  }
523 
524  bool GetOp(const_iterator &pc, opcodetype &opcodeRet,
525  std::vector<uint8_t> &vchRet) const {
526  return GetScriptOp(pc, end(), opcodeRet, &vchRet);
527  }
528 
529  bool GetOp(const_iterator &pc, opcodetype &opcodeRet) const {
530  return GetScriptOp(pc, end(), opcodeRet, nullptr);
531  }
532 
534  static int DecodeOP_N(opcodetype opcode) {
535  if (opcode == OP_0) {
536  return 0;
537  }
538 
539  assert(opcode >= OP_1 && opcode <= OP_16);
540  return int(opcode) - int(OP_1 - 1);
541  }
542  static opcodetype EncodeOP_N(int n) {
543  assert(n >= 0 && n <= 16);
544  if (n == 0) {
545  return OP_0;
546  }
547 
548  return (opcodetype)(OP_1 + n - 1);
549  }
550 
551  bool IsPayToScriptHash() const;
552  bool IsCommitment(const std::vector<uint8_t> &data) const;
553  bool IsWitnessProgram(int &version, std::vector<uint8_t> &program) const;
554  bool IsWitnessProgram() const;
555 
560  bool IsPushOnly(const_iterator pc) const;
561  bool IsPushOnly() const;
562 
564  bool HasValidOps() const;
565 
571  bool IsUnspendable() const {
572  return (size() > 0 && *begin() == OP_RETURN) ||
573  (size() > MAX_SCRIPT_SIZE);
574  }
575 
576  void clear() {
577  // The default prevector::clear() does not release memory
579  shrink_to_fit();
580  }
581 };
582 
583 #endif // BITCOIN_SCRIPT_SCRIPT_H
Definition: script.h:130
Definition: script.h:59
Definition: script.h:115
static const int MAX_PUBKEYS_PER_MULTISIG
Definition: script.h:29
ADD_SERIALIZE_METHODS
Definition: script.h:452
Definition: script.h:98
static int DecodeOP_N(opcodetype opcode)
Encode/decode small integers:
Definition: script.h:534
static int64_t set_vch(const std::vector< uint8_t > &vch)
Definition: script.h:394
int getint() const
Definition: script.h:351
static void WriteLE32(uint8_t *ptr, uint32_t x)
Definition: common.h:40
Definition: script.h:151
static const size_t MAXIMUM_ELEMENT_SIZE
Numeric opcodes (OP_1ADD, etc) are restricted to operating on 4-byte integers.
Definition: script.h:226
CScript(const uint8_t *pbegin, const uint8_t *pend)
Definition: script.h:449
Definition: script.h:90
static const unsigned int MAX_OPCODE
Definition: script.h:199
bool operator==(const CNetAddr &a, const CNetAddr &b)
Definition: netaddress.cpp:368
void clear()
Definition: prevector.h:439
bool operator<(const int64_t &rhs) const
Definition: script.h:250
CScriptNum(const int64_t &n)
Definition: script.h:228
Definition: script.h:76
Definition: script.h:69
Definition: script.h:65
Definition: script.h:92
CScriptNum & operator-=(const int64_t &rhs)
Definition: script.h:337
Definition: script.h:129
bool CheckMinimalPush(const std::vector< uint8_t > &data, opcodetype opcode)
Check whether the given stack element data would be minimally pushed using the given opcode...
Definition: script.cpp:267
Definition: script.h:57
Definition: script.h:136
Definition: script.h:63
static void WriteLE16(uint8_t *ptr, uint16_t x)
Definition: common.h:35
Definition: script.h:58
CScript & push_int64(int64_t n)
Definition: script.h:431
void insert(Tdst &dst, const Tsrc &src)
Simplification of std insertion.
Definition: system.h:476
CScriptNum operator%(const CScriptNum &rhs) const
Definition: script.h:296
static const unsigned int MAX_SCRIPT_ELEMENT_SIZE
Definition: script.h:23
Definition: script.h:150
friend CScript operator+(const CScript &a, const CScript &b)
Definition: script.h:465
bool operator<=(const int64_t &rhs) const
Definition: script.h:249
#define READWRITEAS(type, obj)
Definition: serialize.h:192
CScriptNum & operator=(const int64_t &rhs)
Definition: script.h:323
std::ostream & operator<<(std::ostream &os, const PeerMessagingState &state)
Definition: script.h:71
Definition: script.h:67
static const int MAX_OPS_PER_SCRIPT
Definition: script.h:26
const char * GetOpName(opcodetype opcode)
Definition: script.cpp:13
CScript(opcodetype b)
Definition: script.h:473
Definition: script.h:116
CScriptNum & operator+=(const CScriptNum &rhs)
Definition: script.h:300
bool IsUnspendable() const
Returns whether the script is guaranteed to fail at execution, regardless of the initial stack...
Definition: script.h:571
bool operator<(const CScriptNum &rhs) const
Definition: script.h:263
CScript & operator<<(const CScriptNum &b)
Definition: script.h:489
Definition: script.h:60
iterator end()
Definition: prevector.h:390
CScript & operator<<(opcodetype opcode)
Definition: script.h:481
CScriptNum operator/(const int64_t &rhs) const
Definition: script.h:286
Definition: script.h:137
prevector< 28, uint8_t > CScriptBase
We use a prevector for the script to reduce the considerable memory overhead of vectors in cases wher...
Definition: script.h:422
opcodetype
Script opcodes.
Definition: script.h:46
CScript(const CScriptNum &b)
Definition: script.h:474
bool operator==(const CScriptNum &rhs) const
Definition: script.h:254
CScript & operator<<(const CScript &b)
Definition: script.h:515
Definition: script.h:107
CScriptNum operator+(const int64_t &rhs) const
Definition: script.h:273
bilingual_str operator+(bilingual_str lhs, const bilingual_str &rhs)
Definition: translation.h:30
bool operator!=(const int64_t &rhs) const
Definition: script.h:248
CScriptNum operator-() const
Definition: script.h:318
CScript(int64_t b)
Definition: script.h:471
bool operator>=(const CScriptNum &rhs) const
Definition: script.h:266
CScriptNum operator+(const CScriptNum &rhs) const
Definition: script.h:279
Definition: script.h:62
Definition: script.h:55
Definition: script.h:74
Definition: script.h:99
int64_t m_value
Definition: script.h:413
scriptnum_error(const std::string &str)
Definition: script.h:211
CScript(std::vector< uint8_t >::const_iterator pbegin, std::vector< uint8_t >::const_iterator pend)
Definition: script.h:446
bool operator>(const CScriptNum &rhs) const
Definition: script.h:269
CScript()
Definition: script.h:443
Definition: script.h:134
std::vector< uint8_t > ToByteVector(const T &in)
Definition: script.h:41
bool operator>(const int64_t &rhs) const
Definition: script.h:252
static const int MAX_SCRIPT_SIZE
Definition: script.h:32
Definition: script.h:102
static const int MAX_STACK_SIZE
Definition: script.h:35
Definition: script.h:135
Definition: script.h:80
static std::vector< uint8_t > serialize(const int64_t &value)
Definition: script.h:362
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
Definition: prevector.h:38
CScriptNum operator%(const int64_t &rhs) const
Definition: script.h:293
CScriptNum operator/(const CScriptNum &rhs) const
Definition: script.h:289
bool operator<(const CNetAddr &a, const CNetAddr &b)
Definition: netaddress.cpp:372
CScriptNum & operator-=(const CScriptNum &rhs)
Definition: script.h:303
Definition: script.h:64
CScriptNum operator-(const CScriptNum &rhs) const
Definition: script.h:282
Definition: script.h:96
Definition: script.h:89
std::vector< uint8_t > getvch() const
Definition: script.h:360
CScriptNum operator-(const int64_t &rhs) const
Definition: script.h:276
CScript(const_iterator pbegin, const_iterator pend)
Definition: script.h:444
static opcodetype EncodeOP_N(int n)
Definition: script.h:542
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:429
CScript & operator+=(const CScript &b)
Definition: script.h:459
bool GetOp(const_iterator &pc, opcodetype &opcodeRet) const
Definition: script.h:529
Definition: script.h:61
CScript & operator<<(int64_t b)
Definition: script.h:479
bool GetOp(const_iterator &pc, opcodetype &opcodeRet, std::vector< uint8_t > &vchRet) const
Definition: script.h:524
iterator begin()
Definition: prevector.h:388
CScriptNum & operator+=(const int64_t &rhs)
Definition: script.h:328
size_type size() const
Definition: prevector.h:384
Definition: script.h:68
static const unsigned int LOCKTIME_THRESHOLD
Definition: script.h:39
Definition: script.h:117
Definition: script.h:66
void SerializationOp(Stream &s, Operation ser_action)
Definition: script.h:455
Definition: script.h:75
CScriptNum(const std::vector< uint8_t > &vch, bool fRequireMinimal, const size_t nMaxNumSize=MAXIMUM_ELEMENT_SIZE)
Definition: script.h:230
Definition: script.h:56
Definition: script.h:48
void clear()
Definition: script.h:576
Definition: script.h:133
bool GetScriptOp(CScriptBase::const_iterator &pc, CScriptBase::const_iterator end, opcodetype &opcodeRet, std::vector< uint8_t > *pvchRet)
Definition: script.cpp:446
bool operator==(const int64_t &rhs) const
Definition: script.h:247
bool operator>=(const int64_t &rhs) const
Definition: script.h:251
Definition: script.h:70
Definition: script.h:97
bool operator!=(const CScriptNum &rhs) const
Definition: script.h:257
bool operator<=(const CScriptNum &rhs) const
Definition: script.h:260