Commit e4aaa752 authored by szh's avatar szh

部分接口升级 参数,部分功能调整

parent aee656e6
...@@ -146,6 +146,7 @@ func CornProcessJob(ticker *time.Ticker){ ...@@ -146,6 +146,7 @@ func CornProcessJob(ticker *time.Ticker){
if !BityuanFlag {//有更新,重置等节点重启操作时 禁止运行,防止冲突 if !BityuanFlag {//有更新,重置等节点重启操作时 禁止运行,防止冲突
//节点未启动 会调用auto启动 //节点未启动 会调用auto启动
NodeError = getWalletInfo() NodeError = getWalletInfo()
//升级6.4.0bityuan
updateBityuan640() updateBityuan640()
} }
} }
......
...@@ -30,7 +30,7 @@ func (p *PaiClient) GetWalletStatus() (*types.WalletStatus,error) { ...@@ -30,7 +30,7 @@ func (p *PaiClient) GetWalletStatus() (*types.WalletStatus,error) {
} }
func (p *PaiClient) GetPeerInfo() (*types.PeerList,error) { func (p *PaiClient) GetPeerInfo() (*types.PeerList,error) {
return paiClient.GetPeerInfo(context.Background(),&types.ReqNil{}) return paiClient.GetPeerInfo(context.Background(),&types.P2PGetPeerReq{})
} }
func (p *PaiClient) IsNtpClockSync() (*types.Reply,error) { func (p *PaiClient) IsNtpClockSync() (*types.Reply,error) {
...@@ -38,7 +38,7 @@ func (p *PaiClient) IsNtpClockSync() (*types.Reply,error) { ...@@ -38,7 +38,7 @@ func (p *PaiClient) IsNtpClockSync() (*types.Reply,error) {
} }
func (p *PaiClient) GetNetInfo() (*types.NodeNetInfo,error) { func (p *PaiClient) GetNetInfo() (*types.NodeNetInfo,error) {
return paiClient.NetInfo(context.Background(),&types.ReqNil{}) return paiClient.NetInfo(context.Background(),&types.P2PGetNetInfoReq{})
} }
func (p *PaiClient) Version()(*types.VersionInfo,error){ func (p *PaiClient) Version()(*types.VersionInfo,error){
......
...@@ -19,6 +19,7 @@ import ( ...@@ -19,6 +19,7 @@ import (
"chain33-pai/pkg/chain33" "chain33-pai/pkg/chain33"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
"strings" "strings"
"time"
) )
var flag bool//判断是否正在更新 var flag bool//判断是否正在更新
...@@ -274,6 +275,8 @@ func CloseNode(c* gin.Context){ ...@@ -274,6 +275,8 @@ func CloseNode(c* gin.Context){
app.BityuanFlag = false app.BityuanFlag = false
return return
} }
//防止其他模块未关闭
time.Sleep(time.Second * 2)
appG.Response(http.StatusOK,e.SUCCESS,"node close safe") appG.Response(http.StatusOK,e.SUCCESS,"node close safe")
} }
......
...@@ -6,7 +6,6 @@ import ( ...@@ -6,7 +6,6 @@ import (
"strings" "strings"
"bufio" "bufio"
"chain33-pai/pkg/chain33" "chain33-pai/pkg/chain33"
"chain33-pai/pkg/logging"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
log "github.com/33cn/chain33/common/log/log15" log "github.com/33cn/chain33/common/log/log15"
"net/http" "net/http"
...@@ -62,7 +61,7 @@ func (p *Pai) GetDevstatus() error { ...@@ -62,7 +61,7 @@ func (p *Pai) GetDevstatus() error {
client := &chain33.PaiClient{} client := &chain33.PaiClient{}
peerinfo,err := client.GetPeerInfo() peerinfo,err := client.GetPeerInfo()
if err != nil { if err != nil {
logging.Error("GetDevstatus peerinfo err",err) tlog.Error("GetDevstatus peerinfo ","err",err)
return err return err
} }
...@@ -76,19 +75,19 @@ func (p *Pai) GetDevstatus() error { ...@@ -76,19 +75,19 @@ func (p *Pai) GetDevstatus() error {
} }
sync ,err := client.IsNtpClockSync() sync ,err := client.IsNtpClockSync()
if err != nil { if err != nil {
logging.Error("GetDevstatus IsNtpClockSync err",err) tlog.Error("GetDevstatus IsNtpClockSync"," err",err)
return err return err
} }
p.IsNtpSync = sync.IsOk p.IsNtpSync = sync.IsOk
netinfo,err := client.GetNetInfo() netinfo,err := client.GetNetInfo()
if err != nil { if err != nil {
logging.Error("GetDevstatus GetNetInfo err",err) tlog.Error("GetDevstatus GetNetInfo"," err",err)
return err return err
} }
p.NetInfo = netinfo p.NetInfo = netinfo
walletstatus,err := client.GetWalletStatus() walletstatus,err := client.GetWalletStatus()
if err != nil { if err != nil {
logging.Error("GetDevstatus GetWalletStatus err",err) tlog.Error("GetDevstatus GetWalletStatus ","err",err)
return err return err
} }
p.WalletStatus = walletstatus p.WalletStatus = walletstatus
......
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