Use const in COutPoint class
This commit is contained in:
parent
60b20c869f
commit
6b82fc59eb
1 changed files with 5 additions and 3 deletions
|
@ -21,7 +21,9 @@ public:
|
||||||
uint256 hash;
|
uint256 hash;
|
||||||
uint32_t n;
|
uint32_t n;
|
||||||
|
|
||||||
COutPoint(): n((uint32_t) -1) { }
|
static constexpr uint32_t NULL_INDEX = std::numeric_limits<uint32_t>::max();
|
||||||
|
|
||||||
|
COutPoint(): n(NULL_INDEX) { }
|
||||||
COutPoint(const uint256& hashIn, uint32_t nIn): hash(hashIn), n(nIn) { }
|
COutPoint(const uint256& hashIn, uint32_t nIn): hash(hashIn), n(nIn) { }
|
||||||
|
|
||||||
ADD_SERIALIZE_METHODS;
|
ADD_SERIALIZE_METHODS;
|
||||||
|
@ -32,8 +34,8 @@ public:
|
||||||
READWRITE(n);
|
READWRITE(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetNull() { hash.SetNull(); n = (uint32_t) -1; }
|
void SetNull() { hash.SetNull(); n = NULL_INDEX; }
|
||||||
bool IsNull() const { return (hash.IsNull() && n == (uint32_t) -1); }
|
bool IsNull() const { return (hash.IsNull() && n == NULL_INDEX); }
|
||||||
|
|
||||||
friend bool operator<(const COutPoint& a, const COutPoint& b)
|
friend bool operator<(const COutPoint& a, const COutPoint& b)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue