aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/blockchain_db.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-12-31 16:06:50 -0600
committerluigi1111 <luigi1111w@gmail.com>2018-12-31 16:06:50 -0600
commit69e8567c0e803dfc69e5b6f61be6e94d555ada21 (patch)
treeb0ffe9d25e0227ead3eae03222d7f5d9871d524e /src/blockchain_db/blockchain_db.cpp
parentMerge pull request #4945 (diff)
parenttx_pool: add a few std::move where it can make a difference (diff)
downloadmonero-69e8567c0e803dfc69e5b6f61be6e94d555ada21.tar.xz
Merge pull request #4946
6644b9b blockchain_db: remove a couple unused functions (moneromooo-monero) ce594f5 blockchain_db: allocate known size vector only once (moneromooo-monero) 8332698 db_lmdb: inline check_open, it's trivial and called everywhere (moneromooo-monero) 5511563 db_lmdb: avoid pointless division (moneromooo-monero) d1efe3d cryptonote: set tx hash on newly parsed txes when known (moneromooo-monero) 9cc68a2 tx_pool: add a few std::move where it can make a difference (moneromooo-monero)
Diffstat (limited to 'src/blockchain_db/blockchain_db.cpp')
-rw-r--r--src/blockchain_db/blockchain_db.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/blockchain_db/blockchain_db.cpp b/src/blockchain_db/blockchain_db.cpp
index be0ffeac3..c25798c1e 100644
--- a/src/blockchain_db/blockchain_db.cpp
+++ b/src/blockchain_db/blockchain_db.cpp
@@ -170,7 +170,7 @@ void BlockchainDB::add_transaction(const crypto::hash& blk_hash, const transacti
uint64_t tx_id = add_transaction_data(blk_hash, tx, tx_hash, tx_prunable_hash);
- std::vector<uint64_t> amount_output_indices;
+ std::vector<uint64_t> amount_output_indices(tx.vout.size());
// iterate tx.vout using indices instead of C++11 foreach syntax because
// we need the index
@@ -183,13 +183,13 @@ void BlockchainDB::add_transaction(const crypto::hash& blk_hash, const transacti
cryptonote::tx_out vout = tx.vout[i];
rct::key commitment = rct::zeroCommit(vout.amount);
vout.amount = 0;
- amount_output_indices.push_back(add_output(tx_hash, vout, i, tx.unlock_time,
- &commitment));
+ amount_output_indices[i] = add_output(tx_hash, vout, i, tx.unlock_time,
+ &commitment);
}
else
{
- amount_output_indices.push_back(add_output(tx_hash, tx.vout[i], i, tx.unlock_time,
- tx.version > 1 ? &tx.rct_signatures.outPk[i].mask : NULL));
+ amount_output_indices[i] = add_output(tx_hash, tx.vout[i], i, tx.unlock_time,
+ tx.version > 1 ? &tx.rct_signatures.outPk[i].mask : NULL);
}
}
add_tx_amount_output_indices(tx_id, amount_output_indices);