Skip to content

Commit

Permalink
Merge pull request #1659 from jagerman/remove-sanity-check
Browse files Browse the repository at this point in the history
Disable server-side tx "sanity checks"
  • Loading branch information
jagerman authored Feb 4, 2024
2 parents 1b5a4af + 47264e7 commit 6caaa1d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
10 changes: 0 additions & 10 deletions src/rpc/core_rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#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 "cryptonote_core/uptime_proof.h"
#include "net/parse.h"
#include "crypto/hash.h"
Expand Down Expand Up @@ -1158,15 +1157,6 @@ namespace cryptonote { namespace rpc {
}
auto tx_blob = oxenc::from_hex(req.tx_as_hex);

if (req.do_sanity_checks && !cryptonote::tx_sanity_check(tx_blob, m_core.get_blockchain_storage().get_num_mature_outputs(0)))
{
res.status = "Failed";
res.reason = "Sanity check failed";
res.sanity_check_failed = true;
return res;
}
res.sanity_check_failed = false;

if (req.blink)
{
auto future = m_core.handle_blink_tx(tx_blob);
Expand Down
1 change: 0 additions & 1 deletion src/rpc/core_rpc_server_commands_defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ KV_SERIALIZE_MAP_CODE_END()
KV_SERIALIZE_MAP_CODE_BEGIN(SEND_RAW_TX::request)
KV_SERIALIZE(tx_as_hex)
KV_SERIALIZE_OPT(do_not_relay, false)
KV_SERIALIZE_OPT(do_sanity_checks, true)
KV_SERIALIZE_OPT(blink, false)
KV_SERIALIZE_MAP_CODE_END()

Expand Down
1 change: 0 additions & 1 deletion src/rpc/core_rpc_server_commands_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,6 @@ namespace rpc {
{
std::string tx_as_hex; // Full transaction information as hexidecimal string.
bool do_not_relay; // (Optional: Default false) Stop relaying transaction to other nodes. Ignored if `blink` is true.
bool do_sanity_checks; // (Optional: Default true) Verify TX params have sane values.
bool blink; // (Optional: Default false) Submit this as a blink tx rather than into the mempool.

KV_MAP_SERIALIZABLE
Expand Down
1 change: 0 additions & 1 deletion src/wallet/wallet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6936,7 +6936,6 @@ void wallet2::commit_tx(pending_tx& ptx, bool blink)
rpc::SEND_RAW_TX::request req{};
req.tx_as_hex = oxenc::to_hex(tx_to_blob(ptx.tx));
req.do_not_relay = false;
req.do_sanity_checks = true;
req.blink = blink;
rpc::SEND_RAW_TX::response daemon_send_resp{};
bool r = invoke_http<rpc::SEND_RAW_TX>(req, daemon_send_resp);
Expand Down

0 comments on commit 6caaa1d

Please sign in to comment.