I added the following two lines of code to my function:
uint gas_remaining = msg.gas; //irrelevant code.... refund = refund + ((gas_remaining - msg.gas) * tx.gasprice);
For some reason this is causing the following error:
transact to browser/ballot.sol:Lottery.buyT errored: VM error: revert. revert The transaction has been reverted to the initial state.
Am I doing something wrong?