From c97c4e70e10f2dd204436852f8e7831fe6ed5c7a Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Wed, 10 May 2023 17:01:38 -0400 Subject: [PATCH] journal sendall (untested) --- core/state/journal.go | 14 ++++++++++++++ core/state/statedb.go | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/core/state/journal.go b/core/state/journal.go index cf8ef3e3875cd..4d3c0ffe884d5 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -101,6 +101,9 @@ type ( prev bool // whether account had already suicided prevbalance *big.Int } + sendallChange struct { + account *common.Address + } // Changes to individual accounts. balanceChange struct { @@ -174,6 +177,17 @@ func (ch resetObjectChange) dirtied() *common.Address { return ch.account } +func (ch sendallChange) revert(s *StateDB) { + obj := s.getStateObject(*ch.account) + if obj != nil { + obj.sendalled = false + } +} + +func (ch sendallChange) dirtied() *common.Address { + return nil // TODO: return nil or account here? +} + func (ch suicideChange) revert(s *StateDB) { obj := s.getStateObject(*ch.account) if obj != nil { diff --git a/core/state/statedb.go b/core/state/statedb.go index 6e01785b23418..cb5e5d9ec7c40 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -480,6 +480,10 @@ func (s *StateDB) SendAll(addr common.Address) bool { return false } + s.journal.append(sendallChange{ + account: &addr, + }) + stateObject.sendalled = true return true }