Bugfix state with zero balance
Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
b5fc8e9001
commit
6f4312cb4f
2 changed files with 2 additions and 2 deletions
2
main.py
2
main.py
|
@ -79,7 +79,7 @@ def main():
|
||||||
last_balance, last_transaction = handler.watch_miner(address=config['miner'],
|
last_balance, last_transaction = handler.watch_miner(address=config['miner'],
|
||||||
last_balance=pool_state.get('balance'),
|
last_balance=pool_state.get('balance'),
|
||||||
last_transaction=pool_state.get('payment'))
|
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')
|
logger.debug(f'saving {pool} miner balance to state file')
|
||||||
state.write(pool_name=pool, miner_balance=last_balance)
|
state.write(pool_name=pool, miner_balance=last_balance)
|
||||||
if last_transaction:
|
if last_transaction:
|
||||||
|
|
2
state.py
2
state.py
|
@ -22,7 +22,7 @@ class State:
|
||||||
content[pool_name] = {}
|
content[pool_name] = {}
|
||||||
if block_number:
|
if block_number:
|
||||||
content[pool_name]['block'] = block_number
|
content[pool_name]['block'] = block_number
|
||||||
if miner_balance:
|
if miner_balance is not None:
|
||||||
content[pool_name]['balance'] = miner_balance
|
content[pool_name]['balance'] = miner_balance
|
||||||
if miner_payment:
|
if miner_payment:
|
||||||
content[pool_name]['payment'] = miner_payment
|
content[pool_name]['payment'] = miner_payment
|
||||||
|
|
Reference in a new issue