function refundBet(bytes32 rngId) external {
    
    Bet storage bet = bets[rngId];
    uint amount = bet.amount;
    
    require (amount != 0, "Bet should be in an 'active' state");
    
    
    require (block.number > bet.placeBlockNumber + BET_EXPIRATION_BLOCKS, "Blockhash can't be queried by EVM.");
    
    
    bet.amount = 0;
    
    uint diceWinAmount;
    uint jackpotFee;
    (diceWinAmount, jackpotFee) = getDiceWinAmount(amount, bet.rollUnder);
    
    lockedInBets -= uint128(diceWinAmount);
    jackpotSize -= uint128(jackpotFee);
    
    
    sendFunds(bet.gambler, amount, amount, 0, 0, 0);
  }