Commit 06cad79e authored by szh's avatar szh

update

parent 0a3a1223
...@@ -55,7 +55,10 @@ func main() { ...@@ -55,7 +55,10 @@ func main() {
tlog.Info("[info] start http server listening ", "port",endPoint) tlog.Info("[info] start http server listening ", "port",endPoint)
go func(){ go func(){
time.Sleep(time.Second*10) time.Sleep(time.Second*10)
app.Unlock() err := app.Unlock()
if err == nil {
//app.AutoOpenTicket()
}
}() }()
server.ListenAndServe() server.ListenAndServe()
select {} select {}
......
...@@ -439,17 +439,17 @@ func MVScripts(src,dst string){//Absolute Path ...@@ -439,17 +439,17 @@ func MVScripts(src,dst string){//Absolute Path
os.Chdir(path) os.Chdir(path)
} }
func Unlock(){ func Unlock() error{
var passwd []byte var passwd []byte
f,err:=os.Open(setting.BityuanSetting.Passwd) f,err:=os.Open(setting.BityuanSetting.Passwd)
if err!=nil{ if err!=nil{
tlog.Info("password dose not set") tlog.Info("password dose not set")
return return err
} }
passwd,err=ioutil.ReadAll(f) passwd,err=ioutil.ReadAll(f)
if err!=nil{ if err!=nil{
tlog.Info("Read passwd failed") tlog.Info("Read passwd failed")
return return err
} }
_,err=setting.PaiClient.Unlock(&types.WalletUnLock{ _,err=setting.PaiClient.Unlock(&types.WalletUnLock{
Passwd: string(passwd), Passwd: string(passwd),
...@@ -461,9 +461,15 @@ func Unlock(){ ...@@ -461,9 +461,15 @@ func Unlock(){
}) })
if err!=nil{ if err!=nil{
tlog.Info("unlock auth failed") tlog.Info("unlock auth failed")
return err
} }
return nil
} }
func AutoOpenTicket() error{
return nil
}
func AutoUpdate(tick *time.Ticker) { func AutoUpdate(tick *time.Ticker) {
for { for {
...@@ -501,7 +507,7 @@ func AutoUpdatePai() error { ...@@ -501,7 +507,7 @@ func AutoUpdatePai() error {
return err return err
} }
//解压缩文件 //解压缩文件
tar := exec.Command("tar","-xvf",setting.Chain33Pai.Name) tar := exec.Command("tar","-xvf",name,"../")
err = tar.Start() err = tar.Start()
if err != nil { if err != nil {
tlog.Error("tar","err",err) tlog.Error("tar","err",err)
......
...@@ -13,7 +13,6 @@ type PaiClient struct { ...@@ -13,7 +13,6 @@ type PaiClient struct {
var ( var (
paiClient types.Chain33Client paiClient types.Chain33Client
paiNetgrpcAddr = "localhost:8802" 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