ui: Add wallet_blocks to XMR wallet page.

This commit is contained in:
tecnovert
2024-11-29 12:30:36 +02:00
parent 0dc55fc449
commit 037851a002
5 changed files with 20 additions and 7 deletions

View File

@@ -10285,6 +10285,9 @@ class BasicSwap(BaseApp):
"locked": walletinfo["locked"],
}
if "wallet_blocks" in walletinfo:
rv["wallet_blocks"] = walletinfo["wallet_blocks"]
if "immature_balance" in walletinfo:
rv["immature"] = ci.format_amount(
walletinfo["immature_balance"], conv_int=True

View File

@@ -292,6 +292,7 @@ class XMRInterface(CoinInterface):
rv = {}
balance_info = self.rpc_wallet("get_balance")
rv["wallet_blocks"] = self.rpc_wallet("get_height")["height"]
rv["balance"] = self.format_amount(balance_info["unlocked_balance"])
rv["unconfirmed_balance"] = self.format_amount(
balance_info["balance"] - balance_info["unlocked_balance"]

View File

@@ -163,6 +163,12 @@
{% endif %}
</td>
</tr>
{% if w.wallet_blocks %}
<tr class="opacity-100 text-gray-500 dark:text-gray-100 hover:bg-coolGray-200 dark:hover:bg-gray-600">
<td class="py-3 px-6 bold">Wallet Blocks:</td>
<td class="py-3 px-6">{{ w.wallet_blocks }}{% if w.known_block_count %} / {{ w.known_block_count }}{% endif %}</td>
</tr>
{% endif %}
<tr class="opacity-100 text-gray-500 dark:text-gray-100 hover:bg-coolGray-200 dark:hover:bg-gray-600">
<td class="py-3 px-6 bold">Synced:</td>
<td class="py-3 px-6">{{ w.synced }}</td>
@@ -471,9 +477,9 @@ function copyAndShowMessage(elementId) {
const addressElement = document.getElementById(elementId);
if (!addressElement) return;
const addressText = addressElement.innerText.trim();
if (addressText === 'Copied to clipboard') return;
copyToClipboard(addressText);
addressElement.innerText = 'Copied to clipboard';
const originalWidth = addressElement.offsetWidth;

View File

@@ -38,6 +38,9 @@ def format_wallet_data(swap_client, ci, w):
"havedata": True,
}
if "wallet_blocks" in w:
wf["wallet_blocks"] = w["wallet_blocks"]
if w.get("bootstrapping", False) is True:
wf["bootstrapping"] = True
if "known_block_count" in w: