aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/blockchain_db.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/blockchain_db/blockchain_db.cpp')
-rw-r--r--src/blockchain_db/blockchain_db.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/blockchain_db/blockchain_db.cpp b/src/blockchain_db/blockchain_db.cpp
index a66f4a403..b1b233b58 100644
--- a/src/blockchain_db/blockchain_db.cpp
+++ b/src/blockchain_db/blockchain_db.cpp
@@ -84,12 +84,19 @@ void BlockchainDB::add_transaction(const crypto::hash& blk_hash, const transacti
add_transaction_data(blk_hash, tx, tx_hash);
+ std::vector<uint64_t> amount_output_indices;
+ std::vector<uint64_t> global_output_indices;
+
// iterate tx.vout using indices instead of C++11 foreach syntax because
// we need the index
for (uint64_t i = 0; i < tx.vout.size(); ++i)
{
- add_output(tx_hash, tx.vout[i], i, tx.unlock_time);
+ uint64_t amount_output_index, global_output_index;
+ add_output(tx_hash, tx.vout[i], i, tx.unlock_time, amount_output_index, global_output_index);
+ amount_output_indices.push_back(amount_output_index);
+ global_output_indices.push_back(global_output_index);
}
+ add_amount_and_global_output_indices(tx_hash, amount_output_indices, global_output_indices);
}
uint64_t BlockchainDB::add_block( const block& blk