aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities/blockchain_import.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-10-08 15:55:03 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-10-08 15:55:03 -0500
commitbf525793c724f62d4716aaca59345ba2e13a2c3c (patch)
treead7ea60c6faf8ca103a686529fc1c716e272a9a5 /src/blockchain_utilities/blockchain_import.cpp
parentMerge pull request #5960 (diff)
parentmonerod can now sync from pruned blocks (diff)
downloadmonero-bf525793c724f62d4716aaca59345ba2e13a2c3c.tar.xz
Merge pull request #5915
8330e77 monerod can now sync from pruned blocks (moneromooo-monero)
Diffstat (limited to 'src/blockchain_utilities/blockchain_import.cpp')
-rw-r--r--src/blockchain_utilities/blockchain_import.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp
index a285c2bd0..5d039d7f4 100644
--- a/src/blockchain_utilities/blockchain_import.cpp
+++ b/src/blockchain_utilities/blockchain_import.cpp
@@ -152,7 +152,7 @@ int check_flush(cryptonote::core &core, std::vector<block_complete_entry> &block
}
hashes.push_back(cryptonote::get_block_hash(block));
}
- core.prevalidate_block_hashes(core.get_blockchain_storage().get_db().height(), hashes);
+ core.prevalidate_block_hashes(core.get_blockchain_storage().get_db().height(), hashes, {});
std::vector<block> pblocks;
if (!core.prepare_handle_incoming_blocks(blocks, pblocks))
@@ -178,7 +178,7 @@ int check_flush(cryptonote::core &core, std::vector<block_complete_entry> &block
if(tvc.m_verifivation_failed)
{
MERROR("transaction verification failed, tx_id = "
- << epee::string_tools::pod_to_hex(get_blob_hash(tx_blob)));
+ << epee::string_tools::pod_to_hex(get_blob_hash(tx_blob.blob)));
core.cleanup_handle_incoming_blocks();
return 1;
}
@@ -429,13 +429,17 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path
{
cryptonote::blobdata block;
cryptonote::block_to_blob(bp.block, block);
- std::vector<cryptonote::blobdata> txs;
+ std::vector<tx_blob_entry> txs;
for (const auto &tx: bp.txs)
{
- txs.push_back(cryptonote::blobdata());
- cryptonote::tx_to_blob(tx, txs.back());
+ txs.push_back({cryptonote::blobdata(), crypto::null_hash});
+ cryptonote::tx_to_blob(tx, txs.back().blob);
}
- blocks.push_back({block, txs});
+ block_complete_entry bce;
+ bce.pruned = false;
+ bce.block = std::move(block);
+ bce.txs = std::move(txs);
+ blocks.push_back(bce);
int ret = check_flush(core, blocks, false);
if (ret)
{