diff options
author | Felföldi Zsolt <zsfelfoldi@gmail.com> | 2016-11-28 18:31:15 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-11-28 18:31:15 +0800 |
commit | 665bb43a4c9e97d6f23de02575b92156881a2db8 (patch) | |
tree | 15ce669f45a49b143d07c0b36da74827b42b4594 /light/state_object.go | |
parent | e4bf004560acf18919d5a1b952eeda521ae07aab (diff) | |
download | dexon-665bb43a4c9e97d6f23de02575b92156881a2db8.tar dexon-665bb43a4c9e97d6f23de02575b92156881a2db8.tar.gz dexon-665bb43a4c9e97d6f23de02575b92156881a2db8.tar.bz2 dexon-665bb43a4c9e97d6f23de02575b92156881a2db8.tar.lz dexon-665bb43a4c9e97d6f23de02575b92156881a2db8.tar.xz dexon-665bb43a4c9e97d6f23de02575b92156881a2db8.tar.zst dexon-665bb43a4c9e97d6f23de02575b92156881a2db8.zip |
light: implemented VMState.Empty() (#3357)
Diffstat (limited to 'light/state_object.go')
-rw-r--r-- | light/state_object.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/light/state_object.go b/light/state_object.go index 61c3888fe..6161d2dfb 100644 --- a/light/state_object.go +++ b/light/state_object.go @@ -201,14 +201,19 @@ func (self *StateObject) Copy() *StateObject { // Attribute accessors // +// empty returns whether the account is considered empty. +func (self *StateObject) empty() bool { + return self.nonce == 0 && self.balance.BitLen() == 0 && bytes.Equal(self.codeHash, emptyCodeHash) +} + // Balance returns the account balance func (self *StateObject) Balance() *big.Int { return self.balance } // Address returns the address of the contract/account -func (c *StateObject) Address() common.Address { - return c.address +func (self *StateObject) Address() common.Address { + return self.address } // Code returns the contract code |