diff options
author | luigi1111 <luigi1111w@gmail.com> | 2021-06-24 13:59:12 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2021-06-24 13:59:12 -0500 |
commit | 1796b44c67a5932cfa817069bb48746df01b2540 (patch) | |
tree | 3dcdf15fedd8257b7177a96d58c1b55e4f45a954 /src | |
parent | Merge pull request #7380 (diff) | |
parent | blockchain_import: fix wrong reported block/tx hashes on error (diff) | |
download | monero-1796b44c67a5932cfa817069bb48746df01b2540.tar.xz |
Merge pull request #7611
71741a1 blockchain_import: fix wrong reported block/tx hashes on error (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r-- | src/blockchain_utilities/blockchain_import.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp index df2662444..8d81ef54d 100644 --- a/src/blockchain_utilities/blockchain_import.cpp +++ b/src/blockchain_utilities/blockchain_import.cpp @@ -146,7 +146,7 @@ int check_flush(cryptonote::core &core, std::vector<block_complete_entry> &block if (!parse_and_validate_block_from_blob(b.block, block)) { MERROR("Failed to parse block: " - << epee::string_tools::pod_to_hex(get_blob_hash(b.block))); + << epee::string_tools::buff_to_hex_nodelimer(b.block)); core.cleanup_handle_incoming_blocks(); return 1; } @@ -177,8 +177,11 @@ int check_flush(cryptonote::core &core, std::vector<block_complete_entry> &block core.handle_incoming_tx(tx_blob, tvc, relay_method::block, true); if(tvc.m_verifivation_failed) { - MERROR("transaction verification failed, tx_id = " - << epee::string_tools::pod_to_hex(get_blob_hash(tx_blob.blob))); + cryptonote::transaction transaction; + if (cryptonote::parse_and_validate_tx_from_blob(tx_blob.blob, transaction)) + MERROR("Transaction verification failed, tx_id = " << cryptonote::get_transaction_hash(transaction)); + else + MERROR("Transaction verification failed, transaction is unparsable"); core.cleanup_handle_incoming_blocks(); return 1; } @@ -192,8 +195,11 @@ int check_flush(cryptonote::core &core, std::vector<block_complete_entry> &block if(bvc.m_verifivation_failed) { - MERROR("Block verification failed, id = " - << epee::string_tools::pod_to_hex(get_blob_hash(block_entry.block))); + cryptonote::block block; + if (cryptonote::parse_and_validate_block_from_blob(block_entry.block, block)) + MERROR("Block verification failed, id = " << cryptonote::get_block_hash(block)); + else + MERROR("Block verification failed, block is unparsable"); core.cleanup_handle_incoming_blocks(); return 1; } |