null ptr fix

This commit is contained in:
obscuren 2014-12-04 12:43:12 +01:00
parent 3043b233ea
commit 008e91db6a

View File

@ -143,7 +143,6 @@ func (self *StateTransition) TransitionState() (err error) {
var (
tx = self.tx
sender = self.Sender()
receiver *state.StateObject
)
defer self.RefundGas()
@ -175,7 +174,7 @@ func (self *StateTransition) TransitionState() (err error) {
if tx.CreatesContract() {
self.rec = MakeContract(tx, self.state)
ret, err, ref = vmenv.Create(sender, receiver.Address(), self.tx.Data, self.gas, self.gasPrice, self.value)
ret, err, ref = vmenv.Create(sender, self.rec.Address(), self.tx.Data, self.gas, self.gasPrice, self.value)
ref.SetCode(ret)
} else {
ret, err = vmenv.Call(self.Sender(), self.Receiver().Address(), self.tx.Data, self.gas, self.gasPrice, self.value)