aboutsummaryrefslogtreecommitdiff
path: root/src/uint256.h
diff options
context:
space:
mode:
authorJoão Barbosa <[email protected]>2016-03-18 04:14:19 +0000
committerJoão Barbosa <[email protected]>2016-03-18 08:03:55 +0000
commit0f176927f88084f2f1ce329656878d122fb64623 (patch)
tree78bc77232fdc748477b850de8219ecd82cd835f2 /src/uint256.h
parentMerge #7686: [qt] Remove 0-fee from send dialog (diff)
downloaddiscoin-0f176927f88084f2f1ce329656878d122fb64623.tar.xz
discoin-0f176927f88084f2f1ce329656878d122fb64623.zip
Improve COutPoint less operator
Diffstat (limited to 'src/uint256.h')
-rw-r--r--src/uint256.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/uint256.h b/src/uint256.h
index 4495000f2..bcdb6dd7c 100644
--- a/src/uint256.h
+++ b/src/uint256.h
@@ -42,9 +42,11 @@ public:
memset(data, 0, sizeof(data));
}
- friend inline bool operator==(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) == 0; }
- friend inline bool operator!=(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) != 0; }
- friend inline bool operator<(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) < 0; }
+ inline int Compare(const base_blob& other) const { return memcmp(data, other.data, sizeof(data)); }
+
+ friend inline bool operator==(const base_blob& a, const base_blob& b) { return a.Compare(b) == 0; }
+ friend inline bool operator!=(const base_blob& a, const base_blob& b) { return a.Compare(b) != 0; }
+ friend inline bool operator<(const base_blob& a, const base_blob& b) { return a.Compare(b) < 0; }
std::string GetHex() const;
void SetHex(const char* psz);