diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-03-26 14:30:23 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-03-26 21:10:43 +0000 |
commit | 600a3cf0c0ca0a99dbdc91d32138db3c8aa4165c (patch) | |
tree | edc8745f2439b59a82ee834df9d43721bc6bd475 /src/daemon/command_parser_executor.cpp | |
parent | wallet: handle rare case where fee adjustment can bump to the next kB (diff) | |
download | monero-600a3cf0c0ca0a99dbdc91d32138db3c8aa4165c.tar.xz |
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.
Diffstat (limited to 'src/daemon/command_parser_executor.cpp')
-rw-r--r-- | src/daemon/command_parser_executor.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index 0b42257e7..166fe04ca 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -439,5 +439,23 @@ bool t_command_parser_executor::flush_txpool(const std::vector<std::string>& arg return m_executor.flush_txpool(txid); } +bool t_command_parser_executor::output_histogram(const std::vector<std::string>& args) +{ + if (args.size() > 2) return false; + + uint64_t min_count = 3; + uint64_t max_count = 0; + + if (args.size() >= 1) + { + min_count = boost::lexical_cast<uint64_t>(args[0]); + } + if (args.size() >= 2) + { + max_count = boost::lexical_cast<uint64_t>(args[1]); + } + return m_executor.output_histogram(min_count, max_count); +} + } // namespace daemonize |