aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-02-19 11:15:15 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-03-16 10:32:26 +0000
commit41f727ce42d0fce9e40e4da7bf4abda92eef1016 (patch)
treefec7f8482cf1fdd7e927b91dbab563e785724a5e /src/cryptonote_core/blockchain.h
parentMerge pull request #3410 (diff)
downloadmonero-41f727ce42d0fce9e40e4da7bf4abda92eef1016.tar.xz
add RPC to get a histogram of outputs of a given amount
Diffstat (limited to 'src/cryptonote_core/blockchain.h')
-rw-r--r--src/cryptonote_core/blockchain.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h
index 1a52e20bf..4423199de 100644
--- a/src/cryptonote_core/blockchain.h
+++ b/src/cryptonote_core/blockchain.h
@@ -524,6 +524,17 @@ namespace cryptonote
bool get_random_rct_outs(const COMMAND_RPC_GET_RANDOM_RCT_OUTPUTS::request& req, COMMAND_RPC_GET_RANDOM_RCT_OUTPUTS::response& res) const;
/**
+ * @brief gets per block distribution of outputs of a given amount
+ *
+ * @param amount the amount to get a ditribution for
+ * @param return-by-reference from_height the height before which we do not care about the data
+ * @param return-by-reference start_height the height of the first rct output
+ * @param return-by-reference distribution the start offset of the first rct output in this block (same as previous if none)
+ * @param return-by-reference base how many outputs of that amount are before the stated distribution
+ */
+ bool get_output_distribution(uint64_t amount, uint64_t from_height, uint64_t &start_height, std::vector<uint64_t> &distribution, uint64_t &base) const;
+
+ /**
* @brief gets the global indices for outputs from a given transaction
*
* This function gets the global indices for all outputs belonging
@@ -857,7 +868,17 @@ namespace cryptonote
*
* @return false if any output fails the check, otherwise true
*/
- bool for_all_outputs(std::function<bool(uint64_t amount, const crypto::hash &tx_hash, size_t tx_idx)>) const;
+ bool for_all_outputs(std::function<bool(uint64_t amount, const crypto::hash &tx_hash, uint64_t height, size_t tx_idx)>) const;
+
+ /**
+ * @brief perform a check on all outputs of a given amount in the blockchain
+ *
+ * @param amount the amount to iterate through
+ * @param std::function the check to perform, pass/fail
+ *
+ * @return false if any output fails the check, otherwise true
+ */
+ bool for_all_outputs(uint64_t amount, std::function<bool(uint64_t height)>) const;
/**
* @brief get a reference to the BlockchainDB in use by Blockchain