add balance to startup report

This commit is contained in:
Victor Shyba 2018-11-07 10:39:13 -03:00 committed by Lex Berezhny
parent 60c4a727d3
commit 6ecfc94ff1

View file

@ -2,6 +2,7 @@ import asyncio
import logging import logging
from binascii import unhexlify from binascii import unhexlify
from lbrynet.extras.wallet.dewies import dewies_to_lbc
from lbrynet.schema.error import URIParseError from lbrynet.schema.error import URIParseError
from lbrynet.schema.uri import parse_lbry_uri from lbrynet.schema.uri import parse_lbry_uri
from torba.client.baseledger import BaseLedger from torba.client.baseledger import BaseLedger
@ -85,9 +86,10 @@ class MainNetLedger(BaseLedger):
total_change = len((await account.change.get_addresses())) total_change = len((await account.change.get_addresses()))
channel_count = await account.get_channel_count() channel_count = await account.get_channel_count()
claim_count = await account.get_claim_count() claim_count = await account.get_claim_count()
log.info("Loaded account %s with %d receiving addresses (gap: %d), " balance = dewies_to_lbc(await account.get_balance())
"%d change addresses (gap: %d), %d channels, %d certificates and %d claims.", log.info("Loaded account %s with %s LBC, %d receiving addresses (gap: %d), "
account.id, total_receiving, account.receiving.gap, total_change, account.change.gap, "%d change addresses (gap: %d), %d channels, %d certificates and %d claims. ",
account.id, balance, total_receiving, account.receiving.gap, total_change, account.change.gap,
channel_count, len(account.certificates), claim_count) channel_count, len(account.certificates), claim_count)