diff --git a/main.cpp b/main.cpp index f46c6f8..fa8e7c8 100644 --- a/main.cpp +++ b/main.cpp @@ -76,6 +76,7 @@ main(int ac, const char* av[]) auto enable_mixin_details_opt = opts.get_option("enable-mixin-details"); auto enable_json_api_opt = opts.get_option("enable-json-api"); auto enable_as_hex_opt = opts.get_option("enable-as-hex"); + auto enable_mixin_guess_opt = opts.get_option("enable-mixin-guess"); auto concurrency_opt = opts.get_option("concurrency"); auto enable_emission_monitor_opt = opts.get_option("enable-emission-monitor"); @@ -99,11 +100,11 @@ main(int ac, const char* av[]) bool enable_autorefresh_option {*enable_autorefresh_option_opt}; bool enable_output_key_checker {*enable_output_key_checker_opt}; bool enable_mixin_details {*enable_mixin_details_opt}; + bool enable_mixin_guess {*enable_mixin_guess_opt}; bool enable_json_api {*enable_json_api_opt}; bool enable_as_hex {*enable_as_hex_opt}; bool enable_emission_monitor {*enable_emission_monitor_opt}; - // set monero log output level uint32_t log_level = 0; mlog_configure("", true); @@ -308,6 +309,7 @@ main(int ac, const char* av[]) enable_output_key_checker, enable_autorefresh_option, enable_mixin_details, + enable_mixin_guess, no_blocks_on_index, mempool_info_timeout, *testnet_url, diff --git a/src/CmdLineOptions.cpp b/src/CmdLineOptions.cpp index 4304fc1..486c0fc 100644 --- a/src/CmdLineOptions.cpp +++ b/src/CmdLineOptions.cpp @@ -72,7 +72,9 @@ namespace xmreg ("daemon-login", value(), "Specify username[:password] for daemon RPC client") ("deamon-url,d", value()->default_value("http:://127.0.0.1:18081"), - "Monero daemon url"); + "Monero daemon url") + ("enable-mixin-guess", value()->default_value(false)->implicit_value(true), + "enable guessing real outputs in key images based on viewkey"); store(command_line_parser(acc, avv) diff --git a/src/page.h b/src/page.h index 409f0b3..6fa75d6 100644 --- a/src/page.h +++ b/src/page.h @@ -473,6 +473,7 @@ bool enable_key_image_checker; bool enable_output_key_checker; bool enable_mixins_details; bool enable_as_hex; +bool enable_mixin_guess; bool enable_autorefresh_option; @@ -507,6 +508,7 @@ page(MicroCore* _mcore, bool _enable_output_key_checker, bool _enable_autorefresh_option, bool _enable_mixins_details, + bool _enable_mixin_guess, uint64_t _no_blocks_on_index, uint64_t _mempool_info_timeout, string _testnet_url, @@ -525,6 +527,7 @@ page(MicroCore* _mcore, enable_output_key_checker {_enable_output_key_checker}, enable_autorefresh_option {_enable_autorefresh_option}, enable_mixins_details {_enable_mixins_details}, + enable_mixin_guess {_enable_mixin_guess}, no_blocks_on_index {_no_blocks_on_index}, mempool_info_timeout {_mempool_info_timeout}, testnet_url {_testnet_url}, @@ -2278,13 +2281,21 @@ show_my_outputs(string tx_hash_str, ++output_idx; } + + context.emplace("outputs", outputs); + + context["found_our_outputs"] = (sum_xmr > 0); + context["sum_xmr"] = xmreg::xmr_amount_to_str(sum_xmr); + // we can also test ouputs used in mixins for key images // this can show possible spending. Only possible, because // without a spend key, we cant know for sure. It might be // that our output was used by someone else for their mixins. - bool show_key_images {false}; + if (enable_mixin_guess) { + + bool show_key_images {false}; mstch::array inputs; @@ -2662,10 +2673,9 @@ show_my_outputs(string tx_hash_str, } // for (const txin_to_key& in_key: input_key_imgs) - context.emplace("outputs", outputs); - context["found_our_outputs"] = (sum_xmr > 0); - context["sum_xmr"] = xmreg::xmr_amount_to_str(sum_xmr); + + context.emplace("inputs", inputs); @@ -2707,6 +2717,8 @@ show_my_outputs(string tx_hash_str, context["possible_spending"] = xmreg::xmr_amount_to_str( possible_spending, "{:0.12f}", false); + } // if (enable_mixin_guess) + add_css_style(context); // render the page