Ejemplo n.º 1
0
    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}
Ejemplo n.º 2
0
 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}