fix suicide

This commit is contained in:
Ethan Buchman
2015-08-25 21:47:03 -04:00
parent b9cbb0dac5
commit 586498331b
3 changed files with 67 additions and 13 deletions

View File

@ -174,9 +174,6 @@ func (vm *VM) call(caller, callee *Account, code, input []byte, value int64, gas
switch op {
case STOP: // 0x00
return nil, nil
case ADD: // 0x01
x, y := stack.Pop(), stack.Pop()
xb := new(big.Int).SetBytes(x[:])
@ -837,7 +834,8 @@ func (vm *VM) call(caller, callee *Account, code, input []byte, value int64, gas
if useGasNegative(gas, GasGetAccount, &err) {
return nil, err
}
// TODO if the receiver is , then make it the fee.
// TODO if the receiver is , then make it the fee. (?)
// TODO: create account if doesn't exist (no reason not to)
receiver := vm.appState.GetAccount(addr)
if receiver == nil {
return nil, firstErr(err, ErrUnknownAddress)
@ -849,6 +847,9 @@ func (vm *VM) call(caller, callee *Account, code, input []byte, value int64, gas
dbg.Printf(" => (%X) %v\n", addr[:4], balance)
fallthrough
case STOP: // 0x00
return nil, nil
default:
dbg.Printf("(pc) %-3v Invalid opcode %X\n", pc, op)
return nil, fmt.Errorf("Invalid opcode %X", op)