Changeset View
Changeset View
Standalone View
Standalone View
src/primitives/transaction.h
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | public: | ||||
| template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
| inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
| READWRITE(hash); | READWRITE(hash); | ||||
| READWRITE(n); | READWRITE(n); | ||||
| } | } | ||||
| void SetNull() { | void SetNull() { | ||||
| hash.SetNull(); | hash.SetNull(); | ||||
| n = (uint32_t)-1; | n = uint32_t(-1); | ||||
| } | } | ||||
| bool IsNull() const { return (hash.IsNull() && n == (uint32_t)-1); } | |||||
| bool IsNull() const { return hash.IsNull() && n == uint32_t(-1); } | |||||
| TxId GetTxId() const { return TxId(hash); } | |||||
| uint32_t GetN() const { return n; } | |||||
| friend bool operator<(const COutPoint &a, const COutPoint &b) { | friend bool operator<(const COutPoint &a, const COutPoint &b) { | ||||
| int cmp = a.hash.Compare(b.hash); | int cmp = a.hash.Compare(b.hash); | ||||
| return cmp < 0 || (cmp == 0 && a.n < b.n); | return cmp < 0 || (cmp == 0 && a.n < b.n); | ||||
| } | } | ||||
| friend bool operator==(const COutPoint &a, const COutPoint &b) { | friend bool operator==(const COutPoint &a, const COutPoint &b) { | ||||
| return (a.hash == b.hash && a.n == b.n); | return (a.hash == b.hash && a.n == b.n); | ||||
| ▲ Show 20 Lines • Show All 332 Lines • Show Last 20 Lines | |||||