RollbackInflightDebit rolls back (decreases) the inflight debit balance by the specified amount.
(amount *big.Int)
| 221 | |
| 222 | // RollbackInflightDebit rolls back (decreases) the inflight debit balance by the specified amount. |
| 223 | func (balance *Balance) RollbackInflightDebit(amount *big.Int) { |
| 224 | balance.InitializeBalanceFields() |
| 225 | if balance.InflightDebitBalance.Cmp(amount) >= 0 { |
| 226 | balance.InflightDebitBalance.Sub(balance.InflightDebitBalance, amount) |
| 227 | balance.computeBalance(true) // Update inflight balance. |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | // ApplyPrecision handles both operations involving precision: |
| 232 | // 1. If PreciseAmount exists: converts it to a decimal Amount |