Correctly assign new fee
Assigng the fee value to latestRedemptionFee,
not the value sent to the user
@@ -229,7 +229,7 @@ library DepositRedemption {
require(block.timestamp >= _d.withdrawalRequestTime.add(TBTCConstants.getIncreaseFeeTimer()), "Fee increase not yet permitted");
uint256 _newOutputValue = checkRelationshipToPrevious(_d, _previousOutputValueBytes, _newOutputValueBytes);
- _d.latestRedemptionFee = _newOutputValue;
+ _d.latestRedemptionFee = _d.utxoSize().sub(_newOutputValue);
// Calculate the next sighash
bytes32 _sighash = CheckBitcoinSigs.wpkhSpendSighash(
_d.utxoOutpoint,
