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/vm_env.go | |
parent | e4bf004560acf18919d5a1b952eeda521ae07aab (diff) | |
download | dexon-665bb43a4c9e97d6f23de02575b92156881a2db8.tar.gz dexon-665bb43a4c9e97d6f23de02575b92156881a2db8.tar.zst dexon-665bb43a4c9e97d6f23de02575b92156881a2db8.zip |
light: implemented VMState.Empty() (#3357)
Diffstat (limited to 'light/vm_env.go')
-rw-r--r-- | light/vm_env.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/light/vm_env.go b/light/vm_env.go index 5d330b072..d4d7bcce7 100644 --- a/light/vm_env.go +++ b/light/vm_env.go @@ -263,6 +263,13 @@ func (s *VMState) Exist(addr common.Address) bool { return res } +// Empty returns true if the account at the given address is considered empty +func (s *VMState) Empty(addr common.Address) bool { + so, err := s.state.GetStateObject(s.ctx, addr) + s.errHandler(err) + return so == nil || so.empty() +} + // HasSuicided returns true if the given account has been marked for deletion // or false if the account does not exist func (s *VMState) HasSuicided(addr common.Address) bool { |