AddBalance removes amount from c's balance. It is used to add funds to the destination account of a transfer.
(amount *big.Int)
| 236 | // AddBalance removes amount from c's balance. |
| 237 | // It is used to add funds to the destination account of a transfer. |
| 238 | func (c *stateObject) AddBalance(amount *big.Int) { |
| 239 | // EIP158: We must check emptiness for the objects such that the account |
| 240 | // clearing (0,0,0 objects) can take effect. |
| 241 | if amount.Sign() == 0 { |
| 242 | if c.empty() { |
| 243 | c.touch() |
| 244 | } |
| 245 | |
| 246 | return |
| 247 | } |
| 248 | c.SetBalance(new(big.Int).Add(c.Balance(), amount)) |
| 249 | } |
| 250 | |
| 251 | // SubBalance removes amount from c's balance. |
| 252 | // It is used to remove funds from the origin account of a transfer. |