diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-04-16 22:41:40 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-04-16 22:41:40 +0200 |
commit | 1f01070a0c262e6eeaf37513087756832a2dee92 (patch) | |
tree | ce911db9f29b831cab8b54debc8502656742f582 /src/rpc/core_rpc_server.cpp | |
parent | Merge pull request #5432 (diff) | |
parent | rpc: new sanity check on relayed transactions (diff) | |
download | monero-1f01070a0c262e6eeaf37513087756832a2dee92.tar.xz |
Merge pull request #5434
ccb996af rpc: new sanity check on relayed transactions (moneromooo-monero)
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 52d30e526..c45cb27f3 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -41,6 +41,7 @@ using namespace epee; #include "cryptonote_basic/cryptonote_format_utils.h" #include "cryptonote_basic/account.h" #include "cryptonote_basic/cryptonote_basic_impl.h" +#include "cryptonote_core/tx_sanity_check.h" #include "misc_language.h" #include "net/parse.h" #include "storages/http_abstract_invoke.h" @@ -845,6 +846,14 @@ namespace cryptonote return true; } + if (req.do_sanity_checks && !cryptonote::tx_sanity_check(m_core.get_blockchain_storage(), tx_blob)) + { + res.status = "Failed"; + res.reason = "Sanity check failed"; + res.sanity_check_failed = true; + return true; + } + cryptonote_connection_context fake_context = AUTO_VAL_INIT(fake_context); tx_verification_context tvc = AUTO_VAL_INIT(tvc); if(!m_core.handle_incoming_tx(tx_blob, tvc, false, false, req.do_not_relay) || tvc.m_verifivation_failed) |