mirror of
https://github.com/monero-project/monero.git
synced 2025-07-30 11:58:42 -04:00
blockchain: simple cache for the long term block weights
This commit is contained in:
parent
e4b049da05
commit
9b687c7873
3 changed files with 29 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue