dont skip some key images

master
moneroexamples 5 years ago
parent 20c9de37cf
commit 338c25e354

@ -365,7 +365,7 @@ void Input::identify(transaction const& tx,
if (!known_outputs) if (!known_outputs)
return; return;
auto search_misses {0}; //auto search_misses {0};
auto input_no = tx.vin.size(); 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) } // for (const cryptonote::output_data_t& output_data: outputs)
if (found_a_match == false) // if (found_a_match == false)
{ // {
// if we didnt find any match, break of the look. // // if we didnt find any match, break of the look.
// there is no reason to check remaining key images // // there is no reason to check remaining key images
// as when we spent something, our outputs should be // // as when we spent something, our outputs should be
// in all inputs in a given txs. Thus, if a single input // // in all inputs in a given txs. Thus, if a single input
// is without our output, we can assume this tx does // // is without our output, we can assume this tx does
// not contain any of our spendings. // // not contain any of our spendings.
// just to be sure before we break out of this loop, // // just to be sure before we break out of this loop,
// do it only after two misses // // do it only after two misses
if (++search_misses > 2) // // if (++search_misses > 2)
break; // // break;
} // }
} // for (auto i = 0u; i < input_no; ++i) } // 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 // matches the given key image in the current tx
for (auto const& txi : indices) for (auto const& txi : indices)
{ {
auto const& mixin_tx_hash = txi.first; auto const& mixin_tx_hash = txi.first;
auto const& output_index_in_tx = txi.second;
transaction mixin_tx; transaction mixin_tx;
@ -633,8 +632,6 @@ void RealInput::identify(transaction const& tx,
public_key const& tx_pub_key, public_key const& tx_pub_key,
vector<public_key> const& additional_tx_pub_keys) vector<public_key> const& additional_tx_pub_keys)
{ {
auto search_misses {0};
auto input_no = tx.vin.size(); auto input_no = tx.vin.size();
for (auto i = 0u; i < input_no; ++i) 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 // matches the given key image in the current tx
for (auto const& txi : indices) for (auto const& txi : indices)
{ {
auto const& mixin_tx_hash = txi.first; auto const& mixin_tx_hash = txi.first;
auto const& output_index_in_tx = txi.second;
transaction mixin_tx; transaction mixin_tx;

Loading…
Cancel
Save