From 547a9708de91c175ceab0ddde93785ba93c9efca Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 13 Dec 2018 19:47:47 +0000 Subject: cryptonote: block parsing + hash calculation speedup This saves a duplicate serialization step --- src/wallet/wallet2.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/wallet/wallet2.cpp') diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 53388d659..1e7d8bf42 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2238,9 +2238,7 @@ void wallet2::get_short_chain_history(std::list& ids, uint64_t gra //---------------------------------------------------------------------------------------------------- void wallet2::parse_block_round(const cryptonote::blobdata &blob, cryptonote::block &bl, crypto::hash &bl_id, bool &error) const { - error = !cryptonote::parse_and_validate_block_from_blob(blob, bl); - if (!error) - bl_id = get_block_hash(bl); + error = !cryptonote::parse_and_validate_block_from_blob(blob, bl, bl_id); } //---------------------------------------------------------------------------------------------------- void wallet2::pull_blocks(uint64_t start_height, uint64_t &blocks_start_height, const std::list &short_chain_history, std::vector &blocks, std::vector &o_indices) -- cgit v1.2.3