diff --git a/rootfs/standard/var/www/mynode/bitcoin_info.py b/rootfs/standard/var/www/mynode/bitcoin_info.py index d44a998e..a611d40f 100644 --- a/rootfs/standard/var/www/mynode/bitcoin_info.py +++ b/rootfs/standard/var/www/mynode/bitcoin_info.py @@ -12,6 +12,7 @@ mynode_block_height = 566000 bitcoin_blockchain_info = None bitcoin_recent_blocks = None bitcoin_peers = [] +bitcoin_network_info = None bitcoin_wallet_info = None bitcoin_mempool = None bitcoin_version = None @@ -65,6 +66,7 @@ def update_bitcoin_other_info(): global bitcoin_blockchain_info global bitcoin_recent_blocks global bitcoin_peers + global bitcoin_network_info global bitcoin_mempool global bitcoin_wallet_info @@ -89,6 +91,9 @@ def update_bitcoin_other_info(): # Get peers bitcoin_peers = rpc_connection.getpeerinfo() + # Get network info + bitcoin_network_info = rpc_connection.getnetworkinfo() + # Get mempool bitcoin_mempool = rpc_connection.getmempoolinfo() @@ -123,6 +128,10 @@ def get_bitcoin_peers(): global bitcoin_peers return copy.deepcopy(bitcoin_peers) +def get_bitcoin_network_info(): + global bitcoin_network_info + return copy.deepcopy(bitcoin_network_info) + def get_bitcoin_mempool(): global bitcoin_mempool return copy.deepcopy(bitcoin_mempool) diff --git a/rootfs/standard/var/www/mynode/bitcoind.py b/rootfs/standard/var/www/mynode/bitcoind.py index 3f06869c..03112767 100644 --- a/rootfs/standard/var/www/mynode/bitcoind.py +++ b/rootfs/standard/var/www/mynode/bitcoind.py @@ -117,6 +117,7 @@ def bitcoind_status_page(): info = get_bitcoin_blockchain_info() blockdata = get_bitcoin_recent_blocks() peerdata = get_bitcoin_peers() + networkdata = get_bitcoin_network_info() mempooldata = get_bitcoin_mempool() walletdata = get_bitcoin_wallet_info() version = get_bitcoin_version() @@ -167,6 +168,13 @@ def bitcoind_status_page(): peers.append(peer) + # Local address + local_address = "..." + if networkdata != None: + local_address = "not none" + if "localaddresses" in networkdata: + local_address = "{}:{}".format(networkdata["localaddresses"][0]["address"], networkdata["localaddresses"][0]["port"]) + # Balance walletinfo = {} walletinfo["balance"] = 0.0 @@ -190,6 +198,7 @@ def bitcoind_status_page(): "title": "myNode Bitcoin Status", "blocks": blocks, "peers": peers, + "local_address": local_address, "difficulty": "{:.3g}".format(info["difficulty"]), "block_num": info["blocks"], "header_num": info["headers"], diff --git a/rootfs/standard/var/www/mynode/templates/bitcoind_status.html b/rootfs/standard/var/www/mynode/templates/bitcoind_status.html index 4f349b44..6c2bca9d 100644 --- a/rootfs/standard/var/www/mynode/templates/bitcoind_status.html +++ b/rootfs/standard/var/www/mynode/templates/bitcoind_status.html @@ -90,6 +90,13 @@ +
+
+
Local Bitcoin Address / Port
+
{{local_address}}
+
+
+ {% if confirmed_balance > 0.0 %}
Wallet balance