From 7f4dfa5d5954ac63855ad5c3f004f35d8f89320d Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Wed, 3 Oct 2018 21:24:53 -0400 Subject: [PATCH] Update state object to reflect journal changes --- state/state_object.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/state/state_object.go b/state/state_object.go index 729c4641..95304de5 100644 --- a/state/state_object.go +++ b/state/state_object.go @@ -90,9 +90,9 @@ func (so *stateObject) SetState(db ethstate.Database, key, value ethcmn.Hash) { // since the new value is different, update and journal the change so.stateDB.journal.append(storageChange{ - account: &so.address, - key: prefixKey, - prevalue: prev, + account: &so.address, + key: prefixKey, + prevValue: prev, }) so.setState(prefixKey, value) @@ -104,12 +104,12 @@ func (so *stateObject) setState(key, value ethcmn.Hash) { // SetCode sets the state object's code. func (so *stateObject) SetCode(codeHash ethcmn.Hash, code []byte) { - prevcode := so.Code(nil) + prevCode := so.Code(nil) so.stateDB.journal.append(codeChange{ account: &so.address, - prevhash: so.CodeHash(), - prevcode: prevcode, + prevHash: so.CodeHash(), + prevCode: prevCode, }) so.setCode(codeHash, code) @@ -190,6 +190,10 @@ func (so *stateObject) setError(err error) { } } +func (so *stateObject) markSuicided() { + so.suicided = true +} + // ---------------------------------------------------------------------------- // Getters // ----------------------------------------------------------------------------