function refundBet(uint commit) external {
    
    Game storage game = games[commit];
    uint bet1Amount = game.bet1Amount;
    uint bet2Amount = game.bet2Amount;
    uint bet3Amount = game.bet3Amount;
    uint bet4Amount = game.bet4Amount;
    uint bet5Amount = game.bet5Amount;

    
    require (
      bet1Amount != 0 ||
      bet2Amount != 0 ||
      bet3Amount != 0 ||
      bet4Amount != 0 ||
      bet5Amount != 0,
      "Bet should be in an 'active' state");

    
    require (block.number > game.placeBlockNumber + BET_EXPIRATION_BLOCKS, "Blockhash can't be queried by EVM.");

    
    game.bet1Amount = 0;
    game.bet2Amount = 0;
    game.bet3Amount = 0;
    game.bet4Amount = 0;
    game.bet5Amount = 0;

    
    _lockOrUnlockAmount(
      game.mask,
      bet1Amount,
      bet2Amount,
      bet3Amount,
      bet4Amount,
      bet5Amount,
      0
    );

    
    sendFunds(game.gambler, bet1Amount + bet2Amount + bet3Amount + bet4Amount + bet5Amount);
  }