db: store cumulative rct output distribution in the db for speed

This gets rid of the temporary precalc cache.

Also make the RPC able to send data back in binary or JSON,
since there can be a lot of data

This bumps the LMDB database format to v3, with migration.
This commit is contained in:
moneromooo-monero
2018-05-22 14:46:30 +01:00
parent eed4dba880
commit 45e419bd5c
9 changed files with 315 additions and 177 deletions
+6
View File
@@ -197,6 +197,8 @@ public:
virtual cryptonote::blobdata get_block_blob_from_height(const uint64_t& height) const;
virtual std::vector<uint64_t> get_block_cumulative_rct_outputs(const std::vector<uint64_t> &heights) const;
virtual uint64_t get_block_timestamp(const uint64_t& height) const;
virtual uint64_t get_top_block_timestamp() const;
@@ -317,6 +319,7 @@ private:
, const size_t& block_size
, const difficulty_type& cumulative_difficulty
, const uint64_t& coins_generated
, uint64_t num_rct_outs
, const crypto::hash& block_hash
);
@@ -387,6 +390,9 @@ private:
// migrate from DB version 1 to 2
void migrate_1_2();
// migrate from DB version 2 to 3
void migrate_2_3();
void cleanup_batch();
private: