def handle(self): for table in Table.all(): if table.is_ready(): gh = table.pick_random() players = gh.players winner_address = players[gh.winner] # TODO: should separate payment from table restart total_satoshis = table.price * len(players) payout = int(total_satoshis * (1 - HOUSE_EDGE)) sendmany([(winner_address, payout), (HOUSE_ADDRESS, total_satoshis - payout)]) return {"success": True}
def handle(self): for table in Table.all(): if table.is_ready(): gh = table.pick_random() players = gh.players winner_address = players[gh.winner] # TODO: should separate payment from table restart total_satoshis = table.price * len(players) payout = int(total_satoshis * (1 - HOUSE_EDGE)) sendmany([ (winner_address, payout), (HOUSE_ADDRESS, total_satoshis - payout) ]) return {"success":True}