aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_utilities
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-11-04 20:46:21 +0200
committerRiccardo Spagni <ric@spagni.net>2018-11-04 20:46:21 +0200
commit5141f6e8e875fc6eaec3c21e79c774cc1f06260f (patch)
treeeae34aa5ea061993019cf2d845ff7c83a1a765d3 /src/blockchain_utilities
parentMerge pull request #4691 (diff)
parentblockchain_utilities: simplify getting block blob from height (diff)
downloadmonero-5141f6e8e875fc6eaec3c21e79c774cc1f06260f.tar.xz
Merge pull request #4692
cb4aafd2 blockchain_utilities: simplify getting block blob from height (moneromooo-monero)
Diffstat (limited to 'src/blockchain_utilities')
-rw-r--r--src/blockchain_utilities/blockchain_ancestry.cpp12
-rw-r--r--src/blockchain_utilities/blockchain_depth.cpp3
2 files changed, 5 insertions, 10 deletions
diff --git a/src/blockchain_utilities/blockchain_ancestry.cpp b/src/blockchain_utilities/blockchain_ancestry.cpp
index 2f0bbffd6..e01a8892c 100644
--- a/src/blockchain_utilities/blockchain_ancestry.cpp
+++ b/src/blockchain_utilities/blockchain_ancestry.cpp
@@ -407,8 +407,7 @@ int main(int argc, char* argv[])
for (uint64_t h = state.height; h < db_height; ++h)
{
size_t block_ancestry_size = 0;
- const crypto::hash block_hash = db->get_block_hash_from_height(h);
- const cryptonote::blobdata bd = db->get_block_blob(block_hash);
+ const cryptonote::blobdata bd = db->get_block_blob_from_height(h);
++total_blocks;
cryptonote::block b;
if (!cryptonote::parse_and_validate_block_from_blob(bd, b))
@@ -482,8 +481,7 @@ int main(int argc, char* argv[])
}
else
{
- const crypto::hash block_hash = db->get_block_hash_from_height(od.height);
- cryptonote::blobdata bd = db->get_block_blob(block_hash);
+ cryptonote::blobdata bd = db->get_block_blob_from_height(od.height);
if (!cryptonote::parse_and_validate_block_from_blob(bd, b))
{
LOG_PRINT_L0("Bad block from db");
@@ -620,8 +618,7 @@ int main(int argc, char* argv[])
}
else
{
- const crypto::hash block_hash = db->get_block_hash_from_height(opt_height);
- const cryptonote::blobdata bd = db->get_block_blob(block_hash);
+ const cryptonote::blobdata bd = db->get_block_blob_from_height(opt_height);
cryptonote::block b;
if (!cryptonote::parse_and_validate_block_from_blob(bd, b))
{
@@ -678,8 +675,7 @@ int main(int argc, char* argv[])
{
add_ancestor(ancestry, amount, offset);
const output_data_t od = db->get_output_key(amount, offset);
- const crypto::hash block_hash = db->get_block_hash_from_height(od.height);
- bd = db->get_block_blob(block_hash);
+ bd = db->get_block_blob_from_height(od.height);
cryptonote::block b;
if (!cryptonote::parse_and_validate_block_from_blob(bd, b))
{
diff --git a/src/blockchain_utilities/blockchain_depth.cpp b/src/blockchain_utilities/blockchain_depth.cpp
index dd2387e5b..8060b0de4 100644
--- a/src/blockchain_utilities/blockchain_depth.cpp
+++ b/src/blockchain_utilities/blockchain_depth.cpp
@@ -187,8 +187,7 @@ int main(int argc, char* argv[])
}
else
{
- const crypto::hash block_hash = db->get_block_hash_from_height(opt_height);
- const cryptonote::blobdata bd = db->get_block_blob(block_hash);
+ const cryptonote::blobdata bd = db->get_block_blob_from_height(opt_height);
cryptonote::block b;
if (!cryptonote::parse_and_validate_block_from_blob(bd, b))
{