File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -471,8 +471,14 @@ func (self *StateDB) Copy() *StateDB {
471
471
}
472
472
// Copy the dirty states, logs, and preimages
473
473
for addr := range self .journal .dirties {
474
- state .stateObjects [addr ] = self .stateObjects [addr ].deepCopy (state )
475
- state .stateObjectsDirty [addr ] = struct {}{}
474
+ // As documented [here](https://github.com/ethereum/go-ethereum/pull/16485#issuecomment-380438527),
475
+ // and in the Finalise-method, there is a case where an object is in the journal but not
476
+ // in the stateObjects: OOG after touch on ripeMD prior to Byzantium. Thus, we need to check for
477
+ // nil
478
+ if object , exist := self .stateObjects [addr ]; exist {
479
+ state .stateObjects [addr ] = object .deepCopy (state )
480
+ state .stateObjectsDirty [addr ] = struct {}{}
481
+ }
476
482
}
477
483
// Above, we don't copy the actual journal. This means that if the copy is copied, the
478
484
// loop above will be a no-op, since the copy's journal is empty.
You can’t perform that action at this time.
0 commit comments