aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/block_queue.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-07-19 15:36:07 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-07-20 16:05:56 +0100
commit704b60caf046e98ad6289043ab5f713d2ec3d5a1 (patch)
treea4f1320995b9ddfd537bf90395df4fce5739a964 /src/cryptonote_protocol/block_queue.h
parentMerge pull request #4088 (diff)
downloadmonero-704b60caf046e98ad6289043ab5f713d2ec3d5a1.tar.xz
block_queue: faster check whether a block was requested
Diffstat (limited to '')
-rw-r--r--src/cryptonote_protocol/block_queue.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/block_queue.h b/src/cryptonote_protocol/block_queue.h
index 9059e89ac..9cce95075 100644
--- a/src/cryptonote_protocol/block_queue.h
+++ b/src/cryptonote_protocol/block_queue.h
@@ -33,6 +33,7 @@
#include <string>
#include <vector>
#include <set>
+#include <unordered_set>
#include <boost/thread/recursive_mutex.hpp>
#include <boost/uuid/uuid.hpp>
@@ -93,7 +94,12 @@ namespace cryptonote
bool requested(const crypto::hash &hash) const;
private:
+ void erase_block(block_map::iterator j);
+ inline bool requested_internal(const crypto::hash &hash) const;
+
+ private:
block_map blocks;
mutable boost::recursive_mutex mutex;
+ std::unordered_set<crypto::hash> requested_hashes;
};
}