diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-02-26 18:06:00 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-02-27 15:05:34 +0000 |
commit | 8958b4e7aa24d7f7de6667360b3558e52780e66f (patch) | |
tree | 0fca62135738b6ef82e4f8dcd14e975af469a4fe /src/blockchain_db/blockchain_db.h | |
parent | Merge pull request #6048 (diff) | |
download | monero-8958b4e7aa24d7f7de6667360b3558e52780e66f.tar.xz |
blockchain_db: faster fetching of consecutive txes
Useful for wallet refresh or node sync
Diffstat (limited to '')
-rw-r--r-- | src/blockchain_db/blockchain_db.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h index e9fc85803..d3a218365 100644 --- a/src/blockchain_db/blockchain_db.h +++ b/src/blockchain_db/blockchain_db.h @@ -1291,6 +1291,25 @@ public: virtual bool get_pruned_tx_blobs_from(const crypto::hash& h, size_t count, std::vector<cryptonote::blobdata> &bd) const = 0; /** + * @brief fetches a variable number of blocks and transactions from the given height, in canonical blockchain order + * + * The subclass should return the blocks and transactions stored from the one with the given + * height. The number of blocks returned is variable, based on the max_size passed. + * + * @param start_height the height of the first block + * @param min_count the minimum number of blocks to return, if they exist + * @param max_count the maximum number of blocks to return + * @param max_size the maximum size of block/transaction data to return (will be exceeded by one blocks's worth at most, if min_count is met) + * @param blocks the returned block/transaction data + * @param pruned whether to return full or pruned tx data + * @param skip_coinbase whether to return or skip coinbase transactions (they're in blocks regardless) + * @param get_miner_tx_hash whether to calculate and return the miner (coinbase) tx hash + * + * @return true iff the blocks and transactions were found + */ + virtual bool get_blocks_from(uint64_t start_height, size_t min_count, size_t max_count, size_t max_size, std::vector<std::pair<std::pair<cryptonote::blobdata, crypto::hash>, std::vector<std::pair<crypto::hash, cryptonote::blobdata>>>>& blocks, bool pruned, bool skip_coinbase, bool get_miner_tx_hash) const = 0; + + /** * @brief fetches the prunable transaction blob with the given hash * * The subclass should return the prunable transaction stored which has the given |