mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-23 12:07:17 +00:00
Suicide is deferred to update
This commit is contained in:
parent
fd1d0bbde7
commit
1954ef47e6
@ -150,7 +150,7 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
|
|||||||
case SSTORE:
|
case SSTORE:
|
||||||
var mult *big.Int
|
var mult *big.Int
|
||||||
y, x := stack.Peekn()
|
y, x := stack.Peekn()
|
||||||
val := closure.GetMem(x)
|
val := closure.GetStorage(x)
|
||||||
if val.IsEmpty() && len(y.Bytes()) > 0 {
|
if val.IsEmpty() && len(y.Bytes()) > 0 {
|
||||||
mult = ethutil.Big2
|
mult = ethutil.Big2
|
||||||
} else if !val.IsEmpty() && len(y.Bytes()) == 0 {
|
} else if !val.IsEmpty() && len(y.Bytes()) == 0 {
|
||||||
@ -567,7 +567,7 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
|
|||||||
case SLOAD:
|
case SLOAD:
|
||||||
require(1)
|
require(1)
|
||||||
loc := stack.Pop()
|
loc := stack.Pop()
|
||||||
val := closure.GetMem(loc)
|
val := closure.GetStorage(loc)
|
||||||
|
|
||||||
stack.Push(val.BigInt())
|
stack.Push(val.BigInt())
|
||||||
|
|
||||||
@ -713,10 +713,14 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro
|
|||||||
receiver := vm.state.GetAccount(stack.Pop().Bytes())
|
receiver := vm.state.GetAccount(stack.Pop().Bytes())
|
||||||
receiver.AddAmount(closure.object.Amount)
|
receiver.AddAmount(closure.object.Amount)
|
||||||
|
|
||||||
|
closure.object.MarkForDeletion()
|
||||||
|
|
||||||
|
/*
|
||||||
trie := closure.object.state.trie
|
trie := closure.object.state.trie
|
||||||
trie.NewIterator().Each(func(key string, v *ethutil.Value) {
|
trie.NewIterator().Each(func(key string, v *ethutil.Value) {
|
||||||
trie.Delete(key)
|
trie.Delete(key)
|
||||||
})
|
})
|
||||||
|
*/
|
||||||
|
|
||||||
fallthrough
|
fallthrough
|
||||||
case STOP: // Stop the closure
|
case STOP: // Stop the closure
|
||||||
|
@ -129,7 +129,7 @@ func FormatData(data string) []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RightPadBytes(slice []byte, l int) []byte {
|
func RightPadBytes(slice []byte, l int) []byte {
|
||||||
if l <= len(slice) {
|
if l < len(slice) {
|
||||||
return slice
|
return slice
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ func RightPadBytes(slice []byte, l int) []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func LeftPadBytes(slice []byte, l int) []byte {
|
func LeftPadBytes(slice []byte, l int) []byte {
|
||||||
if l <= len(slice) {
|
if l < len(slice) {
|
||||||
return slice
|
return slice
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user