blockchain: avoid unneeded block copy

pull/200/head
moneromooo-monero 6 years ago
parent 8461df0405
commit 11604b6da6
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

@ -3707,7 +3707,8 @@ leave:
try
{
uint64_t long_term_block_weight = get_next_long_term_block_weight(block_weight);
new_height = m_db->add_block(std::make_pair(std::move(bl), cryptonote::block_to_blob(bl)), block_weight, long_term_block_weight, cumulative_difficulty, already_generated_coins, txs);
cryptonote::blobdata bd = cryptonote::block_to_blob(bl);
new_height = m_db->add_block(std::make_pair(std::move(bl), std::move(bd)), block_weight, long_term_block_weight, cumulative_difficulty, already_generated_coins, txs);
}
catch (const KEY_IMAGE_EXISTS& e)
{

Loading…
Cancel
Save