aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-03-26 11:51:13 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-03-28 18:07:57 +0000
commit9b687c7873f297b23e643a43b09193d2bdb5e095 (patch)
treeaeb7a3c0ea265d2a7e7a93969802dde6504c3ab0 /tests
parentMerge pull request #5286 (diff)
downloadmonero-9b687c7873f297b23e643a43b09193d2bdb5e095.tar.xz
blockchain: simple cache for the long term block weights
Diffstat (limited to 'tests')
-rw-r--r--tests/block_weight/block_weight.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/block_weight/block_weight.cpp b/tests/block_weight/block_weight.cpp
index 1e8974b78..7b3fdfe57 100644
--- a/tests/block_weight/block_weight.cpp
+++ b/tests/block_weight/block_weight.cpp
@@ -84,6 +84,11 @@ public:
while (count-- && start_height < blocks.size()) ret.push_back(blocks[start_height++].long_term_weight);
return ret;
}
+ virtual crypto::hash get_block_hash_from_height(const uint64_t &height) const override {
+ crypto::hash hash = crypto::null_hash;
+ *(uint64_t*)&hash = height;
+ return hash;
+ }
virtual crypto::hash top_block_hash(uint64_t *block_height = NULL) const override {
uint64_t h = height();
crypto::hash top = crypto::null_hash;