core/state: fixed some comments (#21450)
This commit is contained in:
@ -375,22 +375,21 @@ func (s *stateObject) CommitTrie(db Database) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// AddBalance removes amount from c's balance.
|
||||
// AddBalance adds amount to s's balance.
|
||||
// It is used to add funds to the destination account of a transfer.
|
||||
func (s *stateObject) AddBalance(amount *big.Int) {
|
||||
// EIP158: We must check emptiness for the objects such that the account
|
||||
// EIP161: We must check emptiness for the objects such that the account
|
||||
// clearing (0,0,0 objects) can take effect.
|
||||
if amount.Sign() == 0 {
|
||||
if s.empty() {
|
||||
s.touch()
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
s.SetBalance(new(big.Int).Add(s.Balance(), amount))
|
||||
}
|
||||
|
||||
// SubBalance removes amount from c's balance.
|
||||
// SubBalance removes amount from s's balance.
|
||||
// It is used to remove funds from the origin account of a transfer.
|
||||
func (s *stateObject) SubBalance(amount *big.Int) {
|
||||
if amount.Sign() == 0 {
|
||||
@ -455,7 +454,7 @@ func (s *stateObject) Code(db Database) []byte {
|
||||
}
|
||||
|
||||
// CodeSize returns the size of the contract code associated with this object,
|
||||
// or zero if none. This methos is an almost mirror of Code, but uses a cache
|
||||
// or zero if none. This method is an almost mirror of Code, but uses a cache
|
||||
// inside the database to avoid loading codes seen recently.
|
||||
func (s *stateObject) CodeSize(db Database) int {
|
||||
if s.code != nil {
|
||||
|
Reference in New Issue
Block a user