From 7d3fb6c24470900fc630fc0fb54900be566fd3a4 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 1722fb4c02e11..c579a355e0c90 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -98,6 +98,9 @@ type ( prev bool // whether account had already suicided prevbalance *big.Int } + sendallChange struct { + account *common.Address + } // Changes to individual accounts. balanceChange struct { @@ -165,6 +168,17 @@ func (ch resetObjectChange) dirtied() *common.Address { return nil } +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 4f344e79e8b8c..393c8364f60f5 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -479,6 +479,10 @@ func (s *StateDB) SendAll(addr common.Address) bool { return false } + s.journal.append(sendallChange{ + account: &addr, + }) + stateObject.sendalled = true return true }