Merge pull request #5352

ae6885f6 blockchain: incremental long term block weight cache (moneromooo-monero)
9b687c78 blockchain: simple cache for the long term block weights (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2019-04-01 17:34:02 +02:00
commit 29e4e70f30
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
3 changed files with 51 additions and 0 deletions

View file

@ -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;