Avoid repeated (de)serialization when syncing

This commit is contained in:
moneromooo-monero
2018-11-11 14:51:03 +00:00
parent b747e836c8
commit b044d03a51
13 changed files with 80 additions and 69 deletions

View File

@@ -453,7 +453,7 @@ namespace cryptonote
return true;
}
//---------------------------------------------------------------------------------
bool tx_memory_pool::take_tx(const crypto::hash &id, transaction &tx, size_t& tx_weight, uint64_t& fee, bool &relayed, bool &do_not_relay, bool &double_spend_seen)
bool tx_memory_pool::take_tx(const crypto::hash &id, transaction &tx, cryptonote::blobdata &txblob, size_t& tx_weight, uint64_t& fee, bool &relayed, bool &do_not_relay, bool &double_spend_seen)
{
CRITICAL_REGION_LOCAL(m_transactions_lock);
CRITICAL_REGION_LOCAL1(m_blockchain);
@@ -469,7 +469,7 @@ namespace cryptonote
MERROR("Failed to find tx in txpool");
return false;
}
cryptonote::blobdata txblob = m_blockchain.get_txpool_tx_blob(id);
txblob = m_blockchain.get_txpool_tx_blob(id);
auto ci = m_parsed_tx_cache.find(id);
if (ci != m_parsed_tx_cache.end())
{