core, core/vm, crypto: fixes for homestead

* Removed some strange code that didn't apply state reverting properly
* Refactored code setting from vm & state transition to the executioner
* Updated tests
This commit is contained in:
Jeffrey Wilcke
2016-01-19 23:50:00 +01:00
parent 4f4d2b6474
commit b6d88a0e9f
24 changed files with 226 additions and 195 deletions

View File

@ -95,20 +95,6 @@ func GetHeadFastBlockHash(db ethdb.Database) common.Hash {
return common.BytesToHash(data)
}
// GetHeadBlockNum retrieves the block number of the current canonical head block.
func GetHeadBlockNum(db ethdb.Database) *big.Int {
data, _ := db.Get(headBlockKey)
if len(data) == 0 {
return nil
}
header := new(types.Header)
if err := rlp.Decode(bytes.NewReader(data), header); err != nil {
glog.V(logger.Error).Infof("invalid block header RLP for head block: %v", err)
return nil
}
return header.Number
}
// GetHeaderRLP retrieves a block header in its raw RLP database encoding, or nil
// if the header's not found.
func GetHeaderRLP(db ethdb.Database, hash common.Hash) rlp.RawValue {