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

Method RollbackInflightDebit

model/model.go:223–229  ·  view source on GitHub ↗

RollbackInflightDebit rolls back (decreases) the inflight debit balance by the specified amount.

(amount *big.Int)

Source from the content-addressed store, hash-verified

221
222// RollbackInflightDebit rolls back (decreases) the inflight debit balance by the specified amount.
223func (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

Calls 2

computeBalanceMethod · 0.95

Tested by 1