MCPcopy Create free account
hub / github.com/CPChain/chain / SubBalance

Method SubBalance

core/state/state_object.go:253–258  ·  view source on GitHub ↗

SubBalance removes amount from c's balance. It is used to remove funds from the origin account of a transfer.

(amount *big.Int)

Source from the content-addressed store, hash-verified

251// SubBalance removes amount from c's balance.
252// It is used to remove funds from the origin account of a transfer.
253func (c *stateObject) SubBalance(amount *big.Int) {
254 if amount.Sign() == 0 {
255 return
256 }
257 c.SetBalance(new(big.Int).Sub(c.Balance(), amount))
258}
259
260func (self *stateObject) SetBalance(amount *big.Int) {
261 self.db.journal.append(balanceChange{

Callers

nothing calls this directly

Calls 3

SetBalanceMethod · 0.95
BalanceMethod · 0.95
SignMethod · 0.45

Tested by

no test coverage detected