diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-11-21 12:57:51 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-03-25 13:42:32 +0000 |
commit | 11604b6da63d630ee3ba495d20f4ddb8e8807c83 (patch) | |
tree | e56aa00f5f98006d050897d2ff1e61a6aafe538d /src | |
parent | save some database calls when getting top block hash and height (diff) | |
download | monero-11604b6da63d630ee3ba495d20f4ddb8e8807c83.tar.xz |
blockchain: avoid unneeded block copy
Diffstat (limited to '')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index eb3c8d75b..c663d7cef 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -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) { |