Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

built new service_blockchain_explorer() #783

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ based_on_style=facebook
column_limit=240
indent_width=4
continuation_indent_width=4
blank_line_before_class_docstring=True
blank_line_before_nested_class_or_def=True
blank_lines_around_top_level_definition=2
blank_lines_between_top_level_imports_and_variables=1
no_spaces_around_selected_binary_operators=*,/
Expand Down
14 changes: 3 additions & 11 deletions bitdust/blockchain/bismuth_miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import socks
import hashlib
import random
import traceback

#------------------------------------------------------------------------------

Expand Down Expand Up @@ -95,11 +94,8 @@ def check_start_mining():
global _OwnCoinsLastTime
global _WantMoreCoins
global _MiningIsOn
try:
cur_balance = bismuth_wallet.my_balance()
except:
traceback.print_exc()
cur_balance = 'N/A'

cur_balance = bismuth_wallet.my_balance()

lg.info('my wallet address is %s and current balance is %s' % (bismuth_wallet.my_wallet_address(), cur_balance))
if _Debug:
Expand All @@ -108,11 +104,7 @@ def check_start_mining():
if cur_balance == 'N/A':
reactor.callLater(10, check_start_mining) # @UndefinedVariable
return
try:
cur_balance = float(cur_balance)
except:
reactor.callLater(10, check_start_mining) # @UndefinedVariable
return

if _WantMoreCoins and (not _OwnCoinsLastTime or (time.time() - _OwnCoinsLastTime > 60)):
_OwnCoinsLastTime = time.time()
_WantMoreCoins = False
Expand Down
1 change: 1 addition & 0 deletions bitdust/blockchain/bismuth_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ def check_db_for_bootstrap(node):


class CustomLogHandler(logging.Handler):

def emit(self, record):
try:
if _Debug:
Expand Down
11 changes: 9 additions & 2 deletions bitdust/blockchain/bismuth_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,24 @@ def my_wallet_address():


def my_balance():
return client().balance()
try:
_balance = float(client().balance())
except:
lg.exc()
return 'N/A'
return _balance


def latest_transactions(num, offset, for_display, mempool_included):
return client().latest_transactions(num, offset, for_display, mempool_included)


def send_transaction(recipient, amount, operation='', data=''):
def send_transaction(recipient, amount, operation='', data='', raise_errors=False):
error_reply = []
ret = client().send(recipient=recipient, amount=amount, operation=operation, data=data, error_reply=error_reply)
if not ret:
if raise_errors:
raise Exception(error_reply)
return error_reply
return ret

Expand Down
Loading
Loading