aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-08-10 20:05:00 +0200
committerRiccardo Spagni <ric@spagni.net>2015-08-10 20:05:12 +0200
commitb210b304a3670cd055d1176d1e59d5edf4ae5ca0 (patch)
tree90bdfdefc6ca78a503466d4f87b2da863e8975c7 /src
parentMerge pull request #363 (diff)
parentblockchain_db: store key images for tx without outputs too (diff)
downloadmonero-b210b304a3670cd055d1176d1e59d5edf4ae5ca0.tar.xz
Merge pull request #364
533acc3 blockchain_db: store key images for tx without outputs too (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/blockchain_db/blockchain_db.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/blockchain_db/blockchain_db.cpp b/src/blockchain_db/blockchain_db.cpp
index f07f30088..41fee5dc7 100644
--- a/src/blockchain_db/blockchain_db.cpp
+++ b/src/blockchain_db/blockchain_db.cpp
@@ -60,19 +60,16 @@ void BlockchainDB::add_transaction(const crypto::hash& blk_hash, const transacti
// iterate tx.vout using indices instead of C++11 foreach syntax because
// we need the index
- if (tx.vout.size() != 0) // it may be technically possible for a tx to have no outputs
+ for (uint64_t i = 0; i < tx.vout.size(); ++i)
{
- for (uint64_t i = 0; i < tx.vout.size(); ++i)
- {
- add_output(tx_hash, tx.vout[i], i, tx.unlock_time);
- }
+ add_output(tx_hash, tx.vout[i], i, tx.unlock_time);
+ }
- for (const txin_v& tx_input : tx.vin)
+ for (const txin_v& tx_input : tx.vin)
+ {
+ if (tx_input.type() == typeid(txin_to_key))
{
- if (tx_input.type() == typeid(txin_to_key))
- {
- add_spent_key(boost::get<txin_to_key>(tx_input).k_image);
- }
+ add_spent_key(boost::get<txin_to_key>(tx_input).k_image);
}
}
}