1
0
Fork 0

Bugfix state with zero balance

Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
Julien Riou 2021-02-07 09:22:54 +01:00
parent b5fc8e9001
commit 6f4312cb4f
No known key found for this signature in database
GPG key ID: FF42D23B580C89F7
2 changed files with 2 additions and 2 deletions

View file

@ -79,7 +79,7 @@ def main():
last_balance, last_transaction = handler.watch_miner(address=config['miner'],
last_balance=pool_state.get('balance'),
last_transaction=pool_state.get('payment'))
if last_balance:
if last_balance is not None:
logger.debug(f'saving {pool} miner balance to state file')
state.write(pool_name=pool, miner_balance=last_balance)
if last_transaction:

View file

@ -22,7 +22,7 @@ class State:
content[pool_name] = {}
if block_number:
content[pool_name]['block'] = block_number
if miner_balance:
if miner_balance is not None:
content[pool_name]['balance'] = miner_balance
if miner_payment:
content[pool_name]['payment'] = miner_payment