Add tx symbol & add missing fee to mempool tx list

This commit is contained in:
Jason Rhinelander 2020-08-19 23:09:21 -03:00
parent d89177204f
commit 2c394386e3
3 changed files with 7 additions and 4 deletions

View File

@ -155,7 +155,7 @@ def main(refresh=None, page=0, per_page=None, first=None, last=None):
stake = FutureJSON(lmq, lokid, 'rpc.get_staking_requirement', 10)
base_fee = FutureJSON(lmq, lokid, 'rpc.get_fee_estimate', 10)
hfinfo = FutureJSON(lmq, lokid, 'rpc.hard_fork_info', 10)
mempool = FutureJSON(lmq, lokid, 'rpc.get_transaction_pool', 5)
mempool = FutureJSON(lmq, lokid, 'rpc.get_transaction_pool', 5, args=[json.dumps({"tx_extra":True}).encode()])
sns = get_sns_future(lmq, lokid)
# This call is slow the first time it gets called in lokid but will be fast after that, so call

View File

@ -21,11 +21,15 @@
</tr>
</thead>
<tbody>
{% import 'include/tx_type_symbol.html' as symbol %}
{% import 'include/tx_fee.html' as fee %}
{% for tx in mempool.transactions[:mempool_limit] %}
<tr>
<td title="{{tx.receive_time | from_timestamp | format_datetime}}">{{tx.receive_time | from_timestamp | ago}}</td>
<td class=TXType>{{tx_type_symbol}}</td>
<td>{{symbol.display(tx)}}</td>
<td><a href="/tx/{{tx.id_hash}}">{{tx.id_hash}}</a></td>
<td>{{fee.display(tx)}} /
{{(tx.info.rct_signatures.txnFee * 1000 / tx.blob_size) | loki(tag=false, decimals=4)}}</td>
<td>{{tx.info.vin | length}}/{{tx.info.vout | length}}</td>
<td>{{tx.blob_size | si}}B</td>
</tr>

View File

@ -1,7 +1,6 @@
{% macro display(tx, show_zero=false) -%}
{% set fee =
(tx.info.rct_signatures.txnFee if 'rct_signatures' in tx.info and 'txnFee' in tx.info.rct_signatures else 0) +
(tx.extra.burn_amount if 'burn_amount' in tx.info else 0)
(tx.info.rct_signatures.txnFee if 'rct_signatures' in tx.info and 'txnFee' in tx.info.rct_signatures else 0)
-%}
{% if fee > 0 or show_zero -%}
{{ fee | loki(tag=False, fixed=True, decimals=4) }}