cryptonote: block parsing + hash calculation speedup

This saves a duplicate serialization step
This commit is contained in:
moneromooo-monero
2019-03-25 13:43:17 +00:00
parent 11604b6da6
commit 547a9708de
6 changed files with 43 additions and 16 deletions
+1 -3
View File
@@ -2238,9 +2238,7 @@ void wallet2::get_short_chain_history(std::list<crypto::hash>& 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<crypto::hash> &short_chain_history, std::vector<cryptonote::block_complete_entry> &blocks, std::vector<cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices> &o_indices)