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
2121 uint256 hash;
2222 uint32_t n;
2323
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) { }
2527 COutPoint (const uint256& hashIn, uint32_t nIn): hash(hashIn), n(nIn) { }
2628
2729 ADD_SERIALIZE_METHODS;
@@ -32,8 +34,8 @@ class COutPoint
3234 READWRITE (n);
3335 }
3436
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 ); }
3739
3840 friend bool operator <(const COutPoint& a, const COutPoint& b)
3941 {
You can’t perform that action at this time.
0 commit comments