aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities/blockchain_import.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-11-11 14:51:03 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-03-05 11:57:55 +0000
commitb044d03a51e1dc64bebe2461813e0cfc50f71b0d (patch)
treec0efdbeae2f8ed76e9ac628556ff119fe195e5dc /src/blockchain_utilities/blockchain_import.cpp
parentwallet2: don't calculate prefix hash when we don't need it (diff)
downloadmonero-b044d03a51e1dc64bebe2461813e0cfc50f71b0d.tar.xz
Avoid repeated (de)serialization when syncing
Diffstat (limited to 'src/blockchain_utilities/blockchain_import.cpp')
-rw-r--r--src/blockchain_utilities/blockchain_import.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp
index e6ec20c3b..d2c2b1ea9 100644
--- a/src/blockchain_utilities/blockchain_import.cpp
+++ b/src/blockchain_utilities/blockchain_import.cpp
@@ -455,7 +455,7 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path
}
else
{
- std::vector<transaction> txs;
+ std::vector<std::pair<transaction, blobdata>> txs;
std::vector<transaction> archived_txs;
archived_txs = bp.txs;
@@ -472,7 +472,7 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path
// because add_block() calls
// add_transaction(blk_hash, blk.miner_tx) first, and
// then a for loop for the transactions in txs.
- txs.push_back(tx);
+ txs.push_back(std::make_pair(tx, tx_to_blob(tx)));
}
size_t block_weight;
@@ -486,7 +486,7 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path
try
{
uint64_t long_term_block_weight = core.get_blockchain_storage().get_next_long_term_block_weight(block_weight);
- core.get_blockchain_storage().get_db().add_block(b, block_weight, long_term_block_weight, cumulative_difficulty, coins_generated, txs);
+ core.get_blockchain_storage().get_db().add_block(std::make_pair(b, block_to_blob(b)), block_weight, long_term_block_weight, cumulative_difficulty, coins_generated, txs);
}
catch (const std::exception& e)
{