Merge branch 'develop' of github.com:ethereum/go-ethereum into develop

This commit is contained in:
Maran 2014-06-23 16:26:01 +02:00
commit bcb88e7352
2 changed files with 21 additions and 3 deletions

View File

@ -138,6 +138,7 @@ func (self *JSRE) initStdFuncs() {
eth.Set("require", self.require) eth.Set("require", self.require)
eth.Set("stopMining", self.stopMining) eth.Set("stopMining", self.stopMining)
eth.Set("startMining", self.startMining) eth.Set("startMining", self.startMining)
eth.Set("blockDo", self.execBlock)
} }
/* /*
@ -207,3 +208,18 @@ func (self *JSRE) require(call otto.FunctionCall) otto.Value {
return t return t
} }
func (self *JSRE) execBlock(call otto.FunctionCall) otto.Value {
hash, err := call.Argument(0).ToString()
if err != nil {
return otto.UndefinedValue()
}
err = self.ethereum.BlockDo(ethutil.FromHex(hash))
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
return otto.TrueValue()
}

View File

@ -38,9 +38,11 @@ func DoMining(ethereum *eth.Ethereum) {
// Give it some time to connect with peers // Give it some time to connect with peers
time.Sleep(3 * time.Second) time.Sleep(3 * time.Second)
for ethereum.IsUpToDate() == false { /*
time.Sleep(5 * time.Second) for ethereum.IsUpToDate() == false {
} time.Sleep(5 * time.Second)
}
*/
ethutil.Config.Log.Infoln("Miner started") ethutil.Config.Log.Infoln("Miner started")