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
22
src/page.h
22
src/page.h
|
@ -1520,6 +1520,8 @@ namespace xmreg {
|
||||||
for (mstch::node& input_node: inputs)
|
for (mstch::node& input_node: inputs)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
mstch::map& input_map = boost::get<mstch::map>(input_node);
|
||||||
|
|
||||||
// show input amount
|
// show input amount
|
||||||
string& amount = boost::get<string>(
|
string& amount = boost::get<string>(
|
||||||
boost::get<mstch::map>(input_node)["amount"]
|
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)));
|
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>(
|
mstch::array& mixins = boost::get<mstch::array>(
|
||||||
boost::get<mstch::map>(input_node)["mixins"]
|
boost::get<mstch::map>(input_node)["mixins"]
|
||||||
);
|
);
|
||||||
|
@ -1573,7 +1591,6 @@ namespace xmreg {
|
||||||
++idx;
|
++idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
boost::get<mstch::array>(context["txs"]).push_back(tx_context);
|
boost::get<mstch::array>(context["txs"]).push_back(tx_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2324,7 +2341,8 @@ namespace xmreg {
|
||||||
{"amount" , fmt::format("{:0.12f}", XMR_AMOUNT(in_key.amount))},
|
{"amount" , fmt::format("{:0.12f}", XMR_AMOUNT(in_key.amount))},
|
||||||
{"input_idx" , fmt::format("{:02d}", input_idx)},
|
{"input_idx" , fmt::format("{:02d}", input_idx)},
|
||||||
{"mixins" , mstch::array{}},
|
{"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;
|
inputs_xmr_sum += in_key.amount;
|
||||||
|
|
|
@ -125,7 +125,19 @@
|
||||||
<table class="center">
|
<table class="center">
|
||||||
{{#inputs}}
|
{{#inputs}}
|
||||||
<tr>
|
<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>
|
<td>amount: {{amount}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue