From 85552ce1b0bc997f58341f21ab8bbcf7d937ab4b Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 26 Jun 2019 19:13:43 -0400 Subject: change to new (more flexible) p2p design --- include/salticidae/stream.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/salticidae/stream.h') diff --git a/include/salticidae/stream.h b/include/salticidae/stream.h index 7d1456e..dc47792 100644 --- a/include/salticidae/stream.h +++ b/include/salticidae/stream.h @@ -243,6 +243,13 @@ class Blob { return !(*this == other); } + bool operator<(const Blob &other) const { + for (size_t i = _len - 1; i > 0; i--) + if (data[i] != other.data[i]) + return data[i] < other.data[i]; + return data[0] < other.data[0]; + } + size_t cheap_hash() const { return *data; } void serialize(DataStream &s) const { -- cgit v1.2.3