Commit 2130e4b9 authored by ligaishun's avatar ligaishun

Update node.go

parent 8b0af4f3
...@@ -29,7 +29,7 @@ func ResetWallet(c *gin.Context) { ...@@ -29,7 +29,7 @@ func ResetWallet(c *gin.Context) {
log.Fatalln(err) log.Fatalln(err)
return return
} }
err=os.RemoveAll(fmt.Sprintf(path.Dir(app.Bityuan.Path),"/wallet")) err=os.RemoveAll(fmt.Sprintf("%s/wallet",path.Dir(app.Bityuan.Path)))
if err!=nil{ if err!=nil{
appG.Response(http.StatusOK, e.ERROR, "fail to reset wallet") appG.Response(http.StatusOK, e.ERROR, "fail to reset wallet")
log.Fatalln(err) log.Fatalln(err)
...@@ -85,7 +85,7 @@ func UpdateNode(c *gin.Context){ ...@@ -85,7 +85,7 @@ func UpdateNode(c *gin.Context){
return return
} }
app.Copy(setting.BityuanSetting.Name,app.Bityuan.Path) app.Copy(setting.BityuanSetting.Name,app.Bityuan.Path)
app.Copy(fmt.Sprintf(setting.BityuanSetting.Name,"-cli"),app.Bityuan.Path) app.Copy(fmt.Sprintf("%s-cli",setting.BityuanSetting.Name),app.Bityuan.Path)
os.Chdir("..") os.Chdir("..")
os.RemoveAll(setting.BityuanSetting.Name) os.RemoveAll(setting.BityuanSetting.Name)
kill:=exec.Command("kill","-9",app.Bityuan.Pid) kill:=exec.Command("kill","-9",app.Bityuan.Pid)
......
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