Merge pull request #9740

008ba966d blockchain sync: reduce disk writes from 2 to 1 per tx (jeffro256)
This commit is contained in:
tobtoht
2025-03-10 16:20:00 +00:00
29 changed files with 1186 additions and 1636 deletions

View File

@@ -1339,7 +1339,7 @@ namespace cryptonote
if (!skip_validation)
{
tx_verification_context tvc{};
if(!m_core.handle_incoming_tx({tx_blob, crypto::null_hash}, tvc, (req.do_not_relay ? relay_method::none : relay_method::local), false) || tvc.m_verifivation_failed)
if(!m_core.handle_incoming_tx(tx_blob, tvc, (req.do_not_relay ? relay_method::none : relay_method::local), false) || tvc.m_verifivation_failed)
{
res.status = "Failed";
std::string reason = "";
@@ -3518,8 +3518,6 @@ namespace cryptonote
bool core_rpc_server::on_flush_cache(const COMMAND_RPC_FLUSH_CACHE::request& req, COMMAND_RPC_FLUSH_CACHE::response& res, epee::json_rpc::error& error_resp, const connection_context *ctx)
{
RPC_TRACKER(flush_cache);
if (req.bad_txs)
m_core.flush_bad_txs_cache();
if (req.bad_blocks)
m_core.flush_invalid_blocks();
res.status = CORE_RPC_STATUS_OK;

View File

@@ -2775,12 +2775,10 @@ namespace cryptonote
{
struct request_t: public rpc_request_base
{
bool bad_txs;
bool bad_blocks;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE_PARENT(rpc_request_base)
KV_SERIALIZE_OPT(bad_txs, false)
KV_SERIALIZE_OPT(bad_blocks, false)
END_KV_SERIALIZE_MAP()
};

View File

@@ -370,7 +370,7 @@ namespace rpc
tx_verification_context tvc = AUTO_VAL_INIT(tvc);
if(!m_core.handle_incoming_tx({tx_blob, crypto::null_hash}, tvc, (relay ? relay_method::local : relay_method::none), false) || tvc.m_verifivation_failed)
if(!m_core.handle_incoming_tx(tx_blob, tvc, (relay ? relay_method::local : relay_method::none), false) || tvc.m_verifivation_failed)
{
if (tvc.m_verifivation_failed)
{