mirror of
https://github.com/monero-project/monero.git
synced 2026-01-01 23:40:03 -08:00
rpc: new sanity check on relayed transactions
This will weed out some transactions with silly rings
This commit is contained in:
@@ -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"
|
||||
@@ -844,6 +845,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)
|
||||
|
||||
Reference in New Issue
Block a user