mirror of
https://github.com/monero-project/monero.git
synced 2025-07-22 22:10:45 -04:00
New RPC and daemon command to get output histogram
This is a list of existing output amounts along with the number of outputs of that amount in the blockchain. The daemon command takes: - no parameters: all outputs with at least 3 instances - one parameter: all outputs with at least that many instances - two parameters: all outputs within that many instances The default starts at 3 to avoid massive spamming of all dust outputs in the blockchain, and is the current minimum mixin requirement. An optional vector of amounts may be passed, to request histogram only for those outputs.
This commit is contained in:
parent
f9a2fd2ff5
commit
600a3cf0c0
16 changed files with 244 additions and 0 deletions
|
@ -3313,6 +3313,11 @@ bool Blockchain::get_hard_fork_voting_info(uint8_t version, uint32_t &window, ui
|
|||
return m_hardfork->get_voting_info(version, window, votes, threshold, earliest_height, voting);
|
||||
}
|
||||
|
||||
std::map<uint64_t, uint64_t> Blockchain:: get_output_histogram(const std::vector<uint64_t> &amounts) const
|
||||
{
|
||||
return m_db->get_output_histogram(amounts);
|
||||
}
|
||||
|
||||
void Blockchain::load_compiled_in_block_hashes()
|
||||
{
|
||||
if (m_fast_sync && get_blocks_dat_start(m_testnet) != nullptr)
|
||||
|
|
|
@ -682,6 +682,15 @@ namespace cryptonote
|
|||
*/
|
||||
bool flush_txes_from_pool(const std::list<crypto::hash> &txids);
|
||||
|
||||
/**
|
||||
* @brief return a histogram of outputs on the blockchain
|
||||
*
|
||||
* @param amounts optional set of amounts to lookup
|
||||
*
|
||||
* @return a set of amount/instances
|
||||
*/
|
||||
std::map<uint64_t, uint64_t> get_output_histogram(const std::vector<uint64_t> &amounts) const;
|
||||
|
||||
/**
|
||||
* @brief perform a check on all key images in the blockchain
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue