Consensus and bug fixes

* Ensure that each state object has an address that is 20 bytes
* Byte logging for vm
* changed diff output
This commit is contained in:
obscuren
2014-07-10 15:05:06 +02:00
parent d52e5f7130
commit e504088b79
4 changed files with 58 additions and 13 deletions

View File

@ -1,6 +1,7 @@
package ethchain
import (
"fmt"
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethtrie"
"github.com/ethereum/eth-go/ethutil"
@ -36,7 +37,8 @@ func (s *State) Reset() {
continue
}
stateObject.state.Reset()
//stateObject.state.Reset()
stateObject.Reset()
}
s.Empty()
@ -69,6 +71,10 @@ func (self *State) Update() {
if stateObject.remove {
self.DeleteStateObject(stateObject)
} else {
stateObject.Sync()
fmt.Printf("%x %x\n", stateObject.Address(), stateObject.state.Root())
self.UpdateStateObject(stateObject)
}
}
@ -78,7 +84,6 @@ func (self *State) Update() {
if !valid {
self.trie = t2
}
}
// Purges the current trie.