diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-06-29 20:43:14 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-06-29 20:43:14 +0100 |
commit | f11191a8185c152f8777bead8c1ad4771f158699 (patch) | |
tree | eeaa1488535be503e1f916ce6d55060fd2787ba7 /src | |
parent | Merge pull request #870 (diff) | |
download | monero-f11191a8185c152f8777bead8c1ad4771f158699.tar.xz |
rpc: restrict number of fake outs requested in restricted rpc mode
Diffstat (limited to 'src')
-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; |