addCredit adds the specified amount to the credit balances (either inflight or regular). inflight indicates whether the credit is inflight or not.
(amountBigInt *big.Int, inflight bool)
| 94 | // addCredit adds the specified amount to the credit balances (either inflight or regular). |
| 95 | // inflight indicates whether the credit is inflight or not. |
| 96 | func (balance *Balance) addCredit(amountBigInt *big.Int, inflight bool) { |
| 97 | balance.InitializeBalanceFields() // Ensure balance fields are initialized. |
| 98 | |
| 99 | if inflight { |
| 100 | balance.InflightCreditBalance.Add(balance.InflightCreditBalance, amountBigInt) |
| 101 | } else { |
| 102 | balance.CreditBalance.Add(balance.CreditBalance, amountBigInt) |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | // addDebit adds the specified amount to the debit balances (either inflight or regular). |
| 107 | // inflight indicates whether the debit is inflight or not. |