Show LND Channel DB size on Lightning page

This commit is contained in:
Taylor Helsper 2021-07-27 17:09:43 -05:00
parent 11a43b18c9
commit 4ce5f4f535
3 changed files with 16 additions and 0 deletions

View File

@ -447,6 +447,17 @@ def get_lnd_channel_backup_file():
def lnd_channel_backup_exists():
return os.path.isfile( get_lnd_channel_backup_file() )
def lnd_get_channel_db_size():
path = "mainnet"
if is_testnet_enabled():
path = "testnet"
size = "???"
try:
size = subprocess.check_output("ls -lsah /mnt/hdd/mynode/lnd/data/graph/"+path+"/channel.db | awk '{print $6}'", shell=True)
except:
size = "ERR"
return size
def get_lnd_status():
#if not lnd_wallet_exists():
# return "Please create wallet..."

View File

@ -206,6 +206,7 @@ def page_lnd():
"pubkey": pubkey,
"uri": uri,
"ip": ip,
"channel_db_size": lnd_get_channel_db_size(),
"watchtower_enabled": is_watchtower_enabled(),
"lit_password": get_lnd_lit_password(),
"lnd_deposit_address": lnd_deposit_address,

View File

@ -208,6 +208,10 @@
<th>Num Peers</th>
<td>{{num_peers}}</td>
</tr>
<tr>
<th>DB Size</th>
<td>{{channel_db_size}}</td>
</tr>
{% if is_testnet_enabled %}
<tr>
<th>Network</th>