diff --git a/main.py b/main.py index 8ab3ec3..11bf80f 100644 --- a/main.py +++ b/main.py @@ -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: diff --git a/state.py b/state.py index e1a9537..423fbe8 100644 --- a/state.py +++ b/state.py @@ -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