File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ class COutPoint
21
21
uint256 hash;
22
22
uint32_t n;
23
23
24
- COutPoint (): n((uint32_t ) -1 ) { }
24
+ static constexpr uint32_t NULL_INDEX = std::numeric_limits<uint32_t >::max();
25
+
26
+ COutPoint (): n(NULL_INDEX) { }
25
27
COutPoint (const uint256& hashIn, uint32_t nIn): hash(hashIn), n(nIn) { }
26
28
27
29
ADD_SERIALIZE_METHODS;
@@ -32,8 +34,8 @@ class COutPoint
32
34
READWRITE (n);
33
35
}
34
36
35
- void SetNull () { hash.SetNull (); n = ( uint32_t ) - 1 ; }
36
- bool IsNull () const { return (hash.IsNull () && n == ( uint32_t ) - 1 ); }
37
+ void SetNull () { hash.SetNull (); n = NULL_INDEX ; }
38
+ bool IsNull () const { return (hash.IsNull () && n == NULL_INDEX ); }
37
39
38
40
friend bool operator <(const COutPoint& a, const COutPoint& b)
39
41
{
You can’t perform that action at this time.
0 commit comments