MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / RollbackInflightCredit

Method RollbackInflightCredit

model/model.go:214–220  ·  view source on GitHub ↗

RollbackInflightCredit rolls back (decreases) the inflight credit balance by the specified amount.

(amount *big.Int)

Source from the content-addressed store, hash-verified

212
213// RollbackInflightCredit rolls back (decreases) the inflight credit balance by the specified amount.
214func (balance *Balance) RollbackInflightCredit(amount *big.Int) {
215 balance.InitializeBalanceFields()
216 if balance.InflightCreditBalance.Cmp(amount) >= 0 {
217 balance.InflightCreditBalance.Sub(balance.InflightCreditBalance, amount)
218 balance.computeBalance(true) // Update inflight balance.
219 }
220}
221
222// RollbackInflightDebit rolls back (decreases) the inflight debit balance by the specified amount.
223func (balance *Balance) RollbackInflightDebit(amount *big.Int) {

Calls 2

computeBalanceMethod · 0.95

Tested by 1