moneroexamples 7 years ago
parent f0e562217b
commit 4f15c6164d

@ -169,7 +169,7 @@ MempoolStatus::read_mempool()
last_tx.num_nonrct_inputs = sum_data[3]; last_tx.num_nonrct_inputs = sum_data[3];
last_tx.fee_str = xmreg::xmr_amount_to_str(_tx_info.fee, "{:0.3f}", false); last_tx.fee_str = xmreg::xmr_amount_to_str(_tx_info.fee, "{:0.3f}", false);
last_tx.payed_for_kB_str = fmt::format("{:0.3f}", payed_for_kB); last_tx.payed_for_kB_str = fmt::format("{:0.4f}", payed_for_kB);
last_tx.xmr_inputs_str = xmreg::xmr_amount_to_str(last_tx.sum_inputs , "{:0.3f}"); last_tx.xmr_inputs_str = xmreg::xmr_amount_to_str(last_tx.sum_inputs , "{:0.3f}");
last_tx.xmr_outputs_str = xmreg::xmr_amount_to_str(last_tx.sum_outputs, "{:0.3f}"); last_tx.xmr_outputs_str = xmreg::xmr_amount_to_str(last_tx.sum_outputs, "{:0.3f}");
last_tx.timestamp_str = xmreg::timestamp_to_str_gm(_tx_info.receive_time); last_tx.timestamp_str = xmreg::timestamp_to_str_gm(_tx_info.receive_time);

@ -5573,6 +5573,10 @@ namespace xmreg
// use this regex to remove all non friendly characters in payment_id_as_ascii string // use this regex to remove all non friendly characters in payment_id_as_ascii string
static std::regex e {"[^a-zA-Z0-9 ./\\\\!]"}; static std::regex e {"[^a-zA-Z0-9 ./\\\\!]"};
double tx_size = static_cast<double>(txd.size) / 1024.0;
double payed_for_kB = XMR_AMOUNT(txd.fee) / tx_size;
// initalise page tempate map with basic info about blockchain // initalise page tempate map with basic info about blockchain
mstch::map context { mstch::map context {
{"testnet" , testnet}, {"testnet" , testnet},
@ -5582,9 +5586,9 @@ namespace xmreg
{"tx_pub_key" , pod_to_hex(txd.pk)}, {"tx_pub_key" , pod_to_hex(txd.pk)},
{"blk_height" , tx_blk_height_str}, {"blk_height" , tx_blk_height_str},
{"tx_blk_height" , tx_blk_height}, {"tx_blk_height" , tx_blk_height},
{"tx_size" , fmt::format("{:0.4f}", {"tx_size" , fmt::format("{:0.4f}", tx_size)},
static_cast<double>(txd.size) / 1024.0)},
{"tx_fee" , xmreg::xmr_amount_to_str(txd.fee, "{:0.12f}", false)}, {"tx_fee" , xmreg::xmr_amount_to_str(txd.fee, "{:0.12f}", false)},
{"payed_for_kB" , fmt::format("{:0.12f}", payed_for_kB)},
{"tx_version" , static_cast<uint64_t>(txd.version)}, {"tx_version" , static_cast<uint64_t>(txd.version)},
{"blk_timestamp" , blk_timestamp}, {"blk_timestamp" , blk_timestamp},
{"blk_timestamp_uint" , blk.timestamp}, {"blk_timestamp_uint" , blk.timestamp},

@ -8,8 +8,8 @@
<tr> <tr>
<td>age [h:m:s]</td> <td>age [h:m:s]</td>
<td>transaction hash</td> <td>transaction hash</td>
<td>fee</td> <td>fee/per_kB</td>
<td>outputs</td> <!--<td>outputs</td>-->
<td>in/out/pID</td> <td>in/out/pID</td>
<td>ring size</td> <td>ring size</td>
<td>tx size [kB]</td> <td>tx size [kB]</td>
@ -18,8 +18,8 @@
<tr> <tr>
<td>{{age}}</td> <td>{{age}}</td>
<td><a href="/tx/{{hash}}">{{hash}}</a></td> <td><a href="/tx/{{hash}}">{{hash}}</a></td>
<td>{{fee}}</td> <td>{{fee}}/{{payed_for_kB}}</td>
<td>{{xmr_outputs}}</td> <!--<td>{{xmr_outputs}}</td>-->
<td>{{no_inputs}}/{{no_outputs}}/{{pID}}</td> <td>{{no_inputs}}/{{no_outputs}}/{{pID}}</td>
<td>{{mixin}}</td> <td>{{mixin}}</td>
<td>{{txsize}}</td> <td>{{txsize}}</td>

@ -38,7 +38,7 @@
{{/have_raw_tx}} {{/have_raw_tx}}
<tr> <tr>
<td>Block: <a href="/block/{{blk_height}}">{{blk_height}}</a></td> <td>Block: <a href="/block/{{blk_height}}">{{blk_height}}</a></td>
<td>Fee: {{tx_fee}}</td> <td>Fee (per_kB): {{tx_fee}} ({{payed_for_kB}})</td>
<td>Tx size: {{tx_size}} kB</td> <td>Tx size: {{tx_size}} kB</td>
</tr> </tr>
<tr> <tr>

Loading…
Cancel
Save