Changeset View
Changeset View
Standalone View
Standalone View
src/script/script.h
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | enum opcodetype { | ||||
OP_PUBKEYHASH = 0xfd, | OP_PUBKEYHASH = 0xfd, | ||||
OP_PUBKEY = 0xfe, | OP_PUBKEY = 0xfe, | ||||
OP_INVALIDOPCODE = 0xff, | OP_INVALIDOPCODE = 0xff, | ||||
}; | }; | ||||
const char *GetOpName(opcodetype opcode); | const char *GetOpName(opcodetype opcode); | ||||
std::vector<uint8_t> MinimalizeBigEndianArray(const std::vector<uint8_t> &data); | |||||
class scriptnum_error : public std::runtime_error { | class scriptnum_error : public std::runtime_error { | ||||
public: | public: | ||||
explicit scriptnum_error(const std::string &str) | explicit scriptnum_error(const std::string &str) | ||||
: std::runtime_error(str) {} | : std::runtime_error(str) {} | ||||
}; | }; | ||||
class CScriptNum { | class CScriptNum { | ||||
/** | /** | ||||
Show All 20 Lines | explicit CScriptNum(const std::vector<uint8_t> &vch, bool fRequireMinimal, | ||||
} | } | ||||
m_value = set_vch(vch); | m_value = set_vch(vch); | ||||
} | } | ||||
static bool IsMinimallyEncoded( | static bool IsMinimallyEncoded( | ||||
const std::vector<uint8_t> &vch, | const std::vector<uint8_t> &vch, | ||||
const size_t nMaxNumSize = CScriptNum::MAXIMUM_ELEMENT_SIZE); | const size_t nMaxNumSize = CScriptNum::MAXIMUM_ELEMENT_SIZE); | ||||
static bool MinimallyEncode(std::vector<uint8_t> &data); | |||||
inline bool operator==(const int64_t &rhs) const { return m_value == rhs; } | inline bool operator==(const int64_t &rhs) const { return m_value == rhs; } | ||||
inline bool operator!=(const int64_t &rhs) const { return m_value != rhs; } | inline bool operator!=(const int64_t &rhs) const { return m_value != rhs; } | ||||
inline bool operator<=(const int64_t &rhs) const { return m_value <= rhs; } | inline bool operator<=(const int64_t &rhs) const { return m_value <= rhs; } | ||||
inline bool operator<(const int64_t &rhs) const { return m_value < rhs; } | inline bool operator<(const int64_t &rhs) const { return m_value < rhs; } | ||||
inline bool operator>=(const int64_t &rhs) const { return m_value >= rhs; } | inline bool operator>=(const int64_t &rhs) const { return m_value >= rhs; } | ||||
inline bool operator>(const int64_t &rhs) const { return m_value > rhs; } | inline bool operator>(const int64_t &rhs) const { return m_value > rhs; } | ||||
inline bool operator==(const CScriptNum &rhs) const { | inline bool operator==(const CScriptNum &rhs) const { | ||||
▲ Show 20 Lines • Show All 405 Lines • Show Last 20 Lines |