Commit 06cad79e authored by szh's avatar szh

update

parent 0a3a1223
......@@ -55,7 +55,10 @@ func main() {
tlog.Info("[info] start http server listening ", "port",endPoint)
go func(){
time.Sleep(time.Second*10)
app.Unlock()
err := app.Unlock()
if err == nil {
//app.AutoOpenTicket()
}
}()
server.ListenAndServe()
select {}
......
......@@ -439,17 +439,17 @@ func MVScripts(src,dst string){//Absolute Path
os.Chdir(path)
}
func Unlock(){
func Unlock() error{
var passwd []byte
f,err:=os.Open(setting.BityuanSetting.Passwd)
if err!=nil{
tlog.Info("password dose not set")
return
return err
}
passwd,err=ioutil.ReadAll(f)
if err!=nil{
tlog.Info("Read passwd failed")
return
return err
}
_,err=setting.PaiClient.Unlock(&types.WalletUnLock{
Passwd: string(passwd),
......@@ -461,9 +461,15 @@ func Unlock(){
})
if err!=nil{
tlog.Info("unlock auth failed")
return err
}
return nil
}
func AutoOpenTicket() error{
return nil
}
func AutoUpdate(tick *time.Ticker) {
for {
......@@ -501,7 +507,7 @@ func AutoUpdatePai() error {
return err
}
//解压缩文件
tar := exec.Command("tar","-xvf",setting.Chain33Pai.Name)
tar := exec.Command("tar","-xvf",name,"../")
err = tar.Start()
if err != nil {
tlog.Error("tar","err",err)
......
......@@ -13,7 +13,6 @@ type PaiClient struct {
var (
paiClient types.Chain33Client
paiNetgrpcAddr = "localhost:8802"
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment