Skip to content

Commit

Permalink
journal sendall (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwasinger committed Jun 8, 2023
1 parent d8f444a commit c97c4e7
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
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c97c4e7

Please sign in to comment.