From 1593553e03aef8d44621aaf79a33ba25f69a2bd7 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 1 Aug 2016 22:16:00 +0100 Subject: new unlocked parameter to output_histogram This constrains the number of instances of any amount to the unlocked ones (as defined by the default unlock time setting: outputs with non default unlock time are not considered, so may be counted as unlocked even if they are not actually unlocked). --- src/cryptonote_core/blockchain.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/cryptonote_core/blockchain.h') diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index 21086d578..903e0096b 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -688,10 +688,11 @@ namespace cryptonote * @brief return a histogram of outputs on the blockchain * * @param amounts optional set of amounts to lookup + * @param unlocked whether to restrict instances to unlocked ones * * @return a set of amount/instances */ - std::map get_output_histogram(const std::vector &amounts) const; + std::map get_output_histogram(const std::vector &amounts, bool unlocked) const; /** * @brief perform a check on all key images in the blockchain -- cgit v1.2.3 From 11dc091464a6cef41434a0bb9f8604f6151c8dc5 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Tue, 2 Aug 2016 21:48:09 +0100 Subject: Fake outs set is now decided by the wallet This plugs a privacy leak from the wallet to the daemon, as the daemon could previously see what input is included as a transaction input, which the daemon hadn't previously supplied. Now, the wallet requests a particular set of outputs, including the real one. This can result in transactions that can't be accepted if the wallet happens to select too many outputs with non standard unlock times. The daemon could know this and select another output, but the wallet is blind to it. It's currently very unlikely since I don't think anything uses non default unlock times. The wallet requests more outputs than necessary so it can use spares if any of the returns outputs are still locked. If there are not enough spares to reach the desired mixin, the transaction will fail. --- src/cryptonote_core/blockchain.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/cryptonote_core/blockchain.h') diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index 903e0096b..f5950291c 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -439,6 +439,21 @@ namespace cryptonote */ bool get_random_outs_for_amounts(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res) const; + /** + * @brief gets specific outputs to mix with + * + * This function takes an RPC request for outputs to mix with + * and creates an RPC response with the resultant output indices. + * + * Outputs to mix with are specified in the request. + * + * @param req the outputs to return + * @param res return-by-reference the resultant output indices and keys + * + * @return true + */ + bool get_outs(const COMMAND_RPC_GET_OUTPUTS::request& req, COMMAND_RPC_GET_OUTPUTS::response& res) const; + /** * @brief gets the global indices for outputs from a given transaction * -- cgit v1.2.3