diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-07-06 18:17:08 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-07-06 18:17:08 +0200 |
commit | 0b65717a5db7461aeba3f7d370f6a4db4c37aa62 (patch) | |
tree | 59b9983143cc07cd985e3c9f75df72977bde61e0 | |
parent | Merge pull request #879 (diff) | |
parent | rpc: restrict number of fake outs requested in restricted rpc mode (diff) | |
download | monero-0b65717a5db7461aeba3f7d370f6a4db4c37aa62.tar.xz |
Merge pull request #882
f11191a rpc: restrict number of fake outs requested in restricted rpc mode (moneromooo-monero)
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index cfe1057ac..ca18e7e09 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -41,6 +41,8 @@ using namespace epee; #include "crypto/hash.h" #include "core_rpc_server_error_codes.h" +#define MAX_RESTRICTED_FAKE_OUTS_COUNT 40 + namespace cryptonote { @@ -189,6 +191,16 @@ namespace cryptonote { CHECK_CORE_BUSY(); res.status = "Failed"; + + if (m_restricted) + { + if (req.amounts.size() > 100 || req.outs_count > MAX_RESTRICTED_FAKE_OUTS_COUNT) + { + res.status = "Too many outs requested"; + return true; + } + } + if(!m_core.get_random_outs_for_amounts(req, res)) { return true; |