Improve move/copy/default constructor semantics for tx and block

This commit is contained in:
Lee *!* Clagett
2025-03-18 17:55:34 -04:00
parent f90a267fa3
commit 70fe289d82
4 changed files with 118 additions and 49 deletions

View File

@@ -2656,8 +2656,8 @@ bool Blockchain::get_transactions(const t_ids_container& txs_ids, t_tx_container
bool res = pruned ? m_db->get_pruned_tx_blob(tx_hash, tx) : m_db->get_tx_blob(tx_hash, tx);
if (res)
{
txs.push_back(transaction());
res = pruned ? parse_and_validate_tx_base_from_blob(tx, txs.back()) : parse_and_validate_tx_from_blob(tx, txs.back());
auto& added_tx = txs.emplace_back();
res = pruned ? parse_and_validate_tx_base_from_blob(tx, added_tx) : parse_and_validate_tx_from_blob(tx, added_tx);
if (!res)
{
LOG_ERROR("Invalid transaction");