func: function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private {
          
          uint amount = bet.amount;
          uint modulo = bet.modulo;
          uint rollUnder = bet.rollUnder;
          address player = bet.player;
  
          
          require (amount != 0, "Bet should be in an 'active' state");
  
          
          bet.amount = 0;
  
          
          
          
          
          bytes32 entropy = keccak256(abi.encodePacked(reveal, entropyBlockHash));
  
          
          uint dice = uint(entropy) % modulo;
          uint result = (2 ** dice);
          emit Calculations(result, uint(entropy), dice, modulo, rollUnder);
  
  
          uint diceWinAmount;
          uint _jackpotFee;
          (diceWinAmount, _jackpotFee) = getDiceWinAmount(amount, modulo, rollUnder);
  
          uint diceWin = 0;
          uint jackpotWin = 0;
  
          
          if (modulo <= MAX_MASK_MODULO) {
              
              if ((2 ** dice) & bet.mask != 0) {
                  diceWin = diceWinAmount;
              }
  
          } else {
              
              if (dice < rollUnder) {
                  diceWin = diceWinAmount;
              }
  
          }
  
          
          lockedInBets -= uint128(diceWinAmount);
  
          
          if (amount >= MIN_JACKPOT_BET) {
              
              
              uint jackpotRng = (uint(entropy) / modulo) % JACKPOT_MODULO;
  
              
              if (jackpotRng == 0) {
                  jackpotWin = jackpotSize;
                  jackpotSize = 0;
              }
          }
  
          
          if (jackpotWin > 0) {
              emit JackpotPayment(player, jackpotWin);
          }
  
          
          sendFunds(player, diceWin + jackpotWin == 0 ? 1 wei : diceWin + jackpotWin, diceWin);
      }