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

@ -66,6 +66,11 @@ type StateManager struct {
// Mining state. The mining state is used purely and solely by the mining
// operation.
miningState *State
// The last attempted block is mainly used for debugging purposes
// This does not have to be a valid block and will be set during
// 'Process' & canonical validation.
lastAttemptedBlock *Block
}
func NewStateManager(ethereum EthManager) *StateManager {
@ -165,6 +170,8 @@ func (sm *StateManager) Process(block *Block, dontReact bool) (err error) {
return ParentError(block.PrevHash)
}
sm.lastAttemptedBlock = block
var (
parent = sm.bc.GetBlock(block.PrevHash)
state = parent.State()