def mainloop(): while True: time.sleep(1) tx=create_reward_tx() if tools.local_get('stop'): return if 'error' not in tx: api.easy_add_transaction(tx)
def mainloop(): while True: if tools.local_get('stop'): return time.sleep(1) txs=tools.local_get('txs') address=tools.local_get('address') txs=filter(lambda x: address==tools.addr(x), txs) txs=filter(lambda x: x['type']=='sign', txs) if len(txs)==0: tx=create_sign_tx() #tools.log('tx: ' +str(tx)) api.easy_add_transaction(tx) else: time.sleep(1)