diff options
| author | tobtoht <tob@featherwallet.org> | 2025-03-10 16:20:00 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2025-03-10 16:20:00 +0000 |
| commit | 3da68db9789697d30dc309df2f1da5d348bc4ce2 (patch) | |
| tree | 68c98fab9146797007ab778cdb4a609e1e41f43c /tests/core_tests/chaingen.h | |
| parent | 0232839913b13cf0ab0bb7ad25fff0c05f37d2fe (diff) | |
| parent | 008ba966da88f073f226b299533faca905ceabf8 (diff) | |
| download | monzero-core-3da68db9789697d30dc309df2f1da5d348bc4ce2.tar.gz monzero-core-3da68db9789697d30dc309df2f1da5d348bc4ce2.tar.xz monzero-core-3da68db9789697d30dc309df2f1da5d348bc4ce2.zip | |
Merge pull request #9740
008ba966d blockchain sync: reduce disk writes from 2 to 1 per tx (jeffro256)
Diffstat (limited to 'tests/core_tests/chaingen.h')
| -rw-r--r-- | tests/core_tests/chaingen.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h index 2c3c45a44..35b352135 100644 --- a/tests/core_tests/chaingen.h +++ b/tests/core_tests/chaingen.h @@ -568,7 +568,7 @@ public: cryptonote::tx_verification_context tvc = AUTO_VAL_INIT(tvc); size_t pool_size = m_c.get_pool_transactions_count(); - m_c.handle_incoming_tx({t_serializable_object_to_blob(tx), crypto::null_hash}, tvc, m_tx_relay, false); + m_c.handle_incoming_tx(t_serializable_object_to_blob(tx), tvc, m_tx_relay, false); bool tx_added = pool_size + 1 == m_c.get_pool_transactions_count(); bool r = m_validator.check_tx_verification_context(tvc, tx_added, m_ev_index, tx); CHECK_AND_NO_ASSERT_MES(r, false, "tx verification context check failed"); @@ -579,16 +579,17 @@ public: { log_event("cryptonote::transaction"); - std::vector<cryptonote::tx_blob_entry> tx_blobs; + std::vector<cryptonote::blobdata> tx_blobs; std::vector<cryptonote::tx_verification_context> tvcs; cryptonote::tx_verification_context tvc0 = AUTO_VAL_INIT(tvc0); for (const auto &tx: txs) { - tx_blobs.push_back({t_serializable_object_to_blob(tx)}); + tx_blobs.emplace_back(t_serializable_object_to_blob(tx)); tvcs.push_back(tvc0); } size_t pool_size = m_c.get_pool_transactions_count(); - m_c.handle_incoming_txs(tx_blobs, tvcs, m_tx_relay, false); + for (size_t i = 0; i < tx_blobs.size(); ++i) + m_c.handle_incoming_tx(tx_blobs[i], tvcs[i], m_tx_relay, false); size_t tx_added = m_c.get_pool_transactions_count() - pool_size; bool r = m_validator.check_tx_verification_context_array(tvcs, tx_added, m_ev_index, txs); CHECK_AND_NO_ASSERT_MES(r, false, "tx verification context check failed"); |
