|
|
@ -309,15 +309,14 @@ public: |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
/** An outpoint - a combination of a transaction hash and an index n into its vout */ |
|
|
|
class COutPoint |
|
|
|
class BaseOutPoint |
|
|
|
{ |
|
|
|
public: |
|
|
|
uint256 hash; |
|
|
|
uint32_t n; |
|
|
|
|
|
|
|
COutPoint() { SetNull(); } |
|
|
|
COutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; } |
|
|
|
BaseOutPoint() { SetNull(); } |
|
|
|
BaseOutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; } |
|
|
|
|
|
|
|
ADD_SERIALIZE_METHODS; |
|
|
|
|
|
|
@ -330,21 +329,38 @@ public: |
|
|
|
void SetNull() { hash.SetNull(); n = (uint32_t) -1; } |
|
|
|
bool IsNull() const { return (hash.IsNull() && n == (uint32_t) -1); } |
|
|
|
|
|
|
|
friend bool operator<(const COutPoint& a, const COutPoint& b) |
|
|
|
friend bool operator<(const BaseOutPoint& a, const BaseOutPoint& b) |
|
|
|
{ |
|
|
|
return (a.hash < b.hash || (a.hash == b.hash && a.n < b.n)); |
|
|
|
} |
|
|
|
|
|
|
|
friend bool operator==(const COutPoint& a, const COutPoint& b) |
|
|
|
friend bool operator==(const BaseOutPoint& a, const BaseOutPoint& b) |
|
|
|
{ |
|
|
|
return (a.hash == b.hash && a.n == b.n); |
|
|
|
} |
|
|
|
|
|
|
|
friend bool operator!=(const COutPoint& a, const COutPoint& b) |
|
|
|
friend bool operator!=(const BaseOutPoint& a, const BaseOutPoint& b) |
|
|
|
{ |
|
|
|
return !(a == b); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
/** An outpoint - a combination of a transaction hash and an index n into its vout */ |
|
|
|
class COutPoint : public BaseOutPoint |
|
|
|
{ |
|
|
|
public: |
|
|
|
COutPoint() : BaseOutPoint() {}; |
|
|
|
COutPoint(uint256 hashIn, uint32_t nIn) : BaseOutPoint(hashIn, nIn) {}; |
|
|
|
std::string ToString() const; |
|
|
|
}; |
|
|
|
|
|
|
|
/** An outpoint - a combination of a transaction hash and an index n into its sapling
|
|
|
|
* output description (vShieldedOutput) */ |
|
|
|
class SaplingOutPoint : public BaseOutPoint |
|
|
|
{ |
|
|
|
public: |
|
|
|
SaplingOutPoint() : BaseOutPoint() {}; |
|
|
|
SaplingOutPoint(uint256 hashIn, uint32_t nIn) : BaseOutPoint(hashIn, nIn) {}; |
|
|
|
std::string ToString() const; |
|
|
|
}; |
|
|
|
|
|
|
|