From 338c25e354cd64779ef88ebf3c5eec9bca6b1aa2 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Mon, 22 Jul 2019 09:31:56 +0800 Subject: [PATCH] dont skip some key images --- src/UniversalIdentifier.cpp | 40 +++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/UniversalIdentifier.cpp b/src/UniversalIdentifier.cpp index 9c1d2c2..2a897e4 100644 --- a/src/UniversalIdentifier.cpp +++ b/src/UniversalIdentifier.cpp @@ -365,7 +365,7 @@ void Input::identify(transaction const& tx, if (!known_outputs) return; - auto search_misses {0}; + //auto search_misses {0}; auto input_no = tx.vin.size(); @@ -443,21 +443,21 @@ void Input::identify(transaction const& tx, } // for (const cryptonote::output_data_t& output_data: outputs) - if (found_a_match == false) - { - // if we didnt find any match, break of the look. - // there is no reason to check remaining key images - // as when we spent something, our outputs should be - // in all inputs in a given txs. Thus, if a single input - // is without our output, we can assume this tx does - // not contain any of our spendings. - - // just to be sure before we break out of this loop, - // do it only after two misses - - if (++search_misses > 2) - break; - } +// if (found_a_match == false) +// { +// // if we didnt find any match, break of the look. +// // there is no reason to check remaining key images +// // as when we spent something, our outputs should be +// // in all inputs in a given txs. Thus, if a single input +// // is without our output, we can assume this tx does +// // not contain any of our spendings. + +// // just to be sure before we break out of this loop, +// // do it only after two misses + +// // if (++search_misses > 2) +// // break; +// } } // for (auto i = 0u; i < input_no; ++i) } @@ -560,8 +560,7 @@ GuessInput::identify(transaction const& tx, // matches the given key image in the current tx for (auto const& txi : indices) { - auto const& mixin_tx_hash = txi.first; - auto const& output_index_in_tx = txi.second; + auto const& mixin_tx_hash = txi.first; transaction mixin_tx; @@ -633,8 +632,6 @@ void RealInput::identify(transaction const& tx, public_key const& tx_pub_key, vector const& additional_tx_pub_keys) { - auto search_misses {0}; - auto input_no = tx.vin.size(); for (auto i = 0u; i < input_no; ++i) @@ -670,8 +667,7 @@ void RealInput::identify(transaction const& tx, // matches the given key image in the current tx for (auto const& txi : indices) { - auto const& mixin_tx_hash = txi.first; - auto const& output_index_in_tx = txi.second; + auto const& mixin_tx_hash = txi.first; transaction mixin_tx;