addDebit adds the specified amount to the debit balances (either inflight or regular). inflight indicates whether the debit is inflight or not.
(amountBigInt *big.Int, inflight bool)
| 106 | // addDebit adds the specified amount to the debit balances (either inflight or regular). |
| 107 | // inflight indicates whether the debit is inflight or not. |
| 108 | func (balance *Balance) addDebit(amountBigInt *big.Int, inflight bool) { |
| 109 | balance.InitializeBalanceFields() |
| 110 | if inflight { |
| 111 | balance.InflightDebitBalance.Add(balance.InflightDebitBalance, amountBigInt) |
| 112 | } else { |
| 113 | balance.DebitBalance.Add(balance.DebitBalance, amountBigInt) |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | // computeBalance computes the overall balance for inflight and normal balances. |
| 118 | // inflight indicates whether the inflight balance or regular balance should be computed. |