Update state object to reflect journal changes
This commit is contained in:
parent
6a741fc501
commit
7f4dfa5d59
@ -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
|
// since the new value is different, update and journal the change
|
||||||
so.stateDB.journal.append(storageChange{
|
so.stateDB.journal.append(storageChange{
|
||||||
account: &so.address,
|
account: &so.address,
|
||||||
key: prefixKey,
|
key: prefixKey,
|
||||||
prevalue: prev,
|
prevValue: prev,
|
||||||
})
|
})
|
||||||
|
|
||||||
so.setState(prefixKey, value)
|
so.setState(prefixKey, value)
|
||||||
@ -104,12 +104,12 @@ func (so *stateObject) setState(key, value ethcmn.Hash) {
|
|||||||
|
|
||||||
// SetCode sets the state object's code.
|
// SetCode sets the state object's code.
|
||||||
func (so *stateObject) SetCode(codeHash ethcmn.Hash, code []byte) {
|
func (so *stateObject) SetCode(codeHash ethcmn.Hash, code []byte) {
|
||||||
prevcode := so.Code(nil)
|
prevCode := so.Code(nil)
|
||||||
|
|
||||||
so.stateDB.journal.append(codeChange{
|
so.stateDB.journal.append(codeChange{
|
||||||
account: &so.address,
|
account: &so.address,
|
||||||
prevhash: so.CodeHash(),
|
prevHash: so.CodeHash(),
|
||||||
prevcode: prevcode,
|
prevCode: prevCode,
|
||||||
})
|
})
|
||||||
|
|
||||||
so.setCode(codeHash, code)
|
so.setCode(codeHash, code)
|
||||||
@ -190,6 +190,10 @@ func (so *stateObject) setError(err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (so *stateObject) markSuicided() {
|
||||||
|
so.suicided = true
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Getters
|
// Getters
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user