From 48f9af85fa46e49ac3e4be1bdfae7a6a470ea9cd Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Tue, 9 Apr 2024 14:11:12 +0800 Subject: [PATCH] core/state: add method doc --- core/state/statedb.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/state/statedb.go b/core/state/statedb.go index ff516d5438..c4a10f3bb9 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1365,6 +1365,9 @@ func copy2DSet[k comparable](set map[k]map[common.Hash][]byte) map[k]map[common. return copied } +// markDelete is invoked when an account is deleted but the deletion is +// not yet committed. The pending mutation is cached and will be applied +// all together func (s *StateDB) markDelete(addr common.Address) { if _, ok := s.mutations[addr]; !ok { s.mutations[addr] = &mutation{} @@ -1373,6 +1376,9 @@ func (s *StateDB) markDelete(addr common.Address) { s.mutations[addr].typ = deletion } +// markUpdate is invoked when an account is modified but the mutation is +// not yet committed. The pending mutation is cached and will be applied +// all together. func (s *StateDB) markUpdate(addr common.Address) { if _, ok := s.mutations[addr]; !ok { s.mutations[addr] = &mutation{}