mirror of
https://git.wownero.com/wownero/onion-wownero-blockchain-explorer.git
synced 2024-08-15 00:33:12 +00:00
show which key images were spend for ran signed tx
This commit is contained in:
parent
34e9aa72d7
commit
24dc2502fd
2 changed files with 37 additions and 7 deletions
24
src/page.h
24
src/page.h
|
@ -1520,6 +1520,8 @@ namespace xmreg {
|
|||
for (mstch::node& input_node: inputs)
|
||||
{
|
||||
|
||||
mstch::map& input_map = boost::get<mstch::map>(input_node);
|
||||
|
||||
// show input amount
|
||||
string& amount = boost::get<string>(
|
||||
boost::get<mstch::map>(input_node)["amount"]
|
||||
|
@ -1527,6 +1529,22 @@ namespace xmreg {
|
|||
|
||||
amount = fmt::format("{:0.12f}", XMR_AMOUNT(real_amounts.at(input_idx)));
|
||||
|
||||
// check if key images are spend or not
|
||||
|
||||
string& in_key_img_str = boost::get<string>(
|
||||
boost::get<mstch::map>(input_node)["in_key_img"]
|
||||
);
|
||||
|
||||
key_image key_imgage;
|
||||
|
||||
if (epee::string_tools::hex_to_pod(in_key_img_str, key_imgage))
|
||||
{
|
||||
|
||||
input_map["already_spent"] = core_storage->get_db().has_key_image(key_imgage);
|
||||
}
|
||||
|
||||
// mark real mixings
|
||||
|
||||
mstch::array& mixins = boost::get<mstch::array>(
|
||||
boost::get<mstch::map>(input_node)["mixins"]
|
||||
);
|
||||
|
@ -1573,7 +1591,6 @@ namespace xmreg {
|
|||
++idx;
|
||||
}
|
||||
|
||||
|
||||
boost::get<mstch::array>(context["txs"]).push_back(tx_context);
|
||||
}
|
||||
|
||||
|
@ -2320,11 +2337,12 @@ namespace xmreg {
|
|||
outputs);
|
||||
|
||||
inputs.push_back(mstch::map {
|
||||
{"in_key_img", REMOVE_HASH_BRAKETS(fmt::format("{:s}", in_key.k_image))},
|
||||
{"in_key_img" , REMOVE_HASH_BRAKETS(fmt::format("{:s}", in_key.k_image))},
|
||||
{"amount" , fmt::format("{:0.12f}", XMR_AMOUNT(in_key.amount))},
|
||||
{"input_idx" , fmt::format("{:02d}", input_idx)},
|
||||
{"mixins" , mstch::array{}},
|
||||
{"ring_sigs" , txd.get_ring_sig_for_input(input_idx)}
|
||||
{"ring_sigs" , txd.get_ring_sig_for_input(input_idx)},
|
||||
{"already_spent", false} // placeholder for later
|
||||
});
|
||||
|
||||
inputs_xmr_sum += in_key.amount;
|
||||
|
|
|
@ -125,7 +125,19 @@
|
|||
<table class="center">
|
||||
{{#inputs}}
|
||||
<tr>
|
||||
<td style="text-align: left;">key image {{input_idx}}: {{in_key_img}}</td>
|
||||
<td style="text-align: left;">
|
||||
key image {{input_idx}}: {{in_key_img}}
|
||||
{{#have_raw_tx}}
|
||||
Already spent:
|
||||
{{#already_spent}}
|
||||
<span style="color: red; font-weight: bold;">True</span>
|
||||
{{/already_spent}}
|
||||
{{^already_spent}}
|
||||
False
|
||||
{{/already_spent}}
|
||||
|
||||
{{/#have_raw_tx}}
|
||||
</td>
|
||||
<td>amount: {{amount}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
Loading…
Reference in a new issue