Skip to content

Commit

Permalink
journal sendall (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwasinger committed May 10, 2023
1 parent 06c795d commit 7d3fb6c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/state/journal.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions core/state/statedb.go
Expand Up @@ -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
}
Expand Down

0 comments on commit 7d3fb6c

Please sign in to comment.