• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: Commit

Golang implemented sidechain for Bytom


Commit MetaInfo

Revision04272793707574f68be8b888d5ecd50387fc32b4 (tree)
Time2019-08-21 12:02:56
AuthorHAOYUatHZ <haoyu@prot...>
CommiterHAOYUatHZ

Log Message

???

Change Summary

Incremental Difference

--- a/toolbar/precog/monitor/monitor.go
+++ b/toolbar/precog/monitor/monitor.go
@@ -196,10 +196,9 @@ func (m *monitor) checkStatusRoutine() {
196196 if peerInfo.Height > bestHeight {
197197 bestHeight = peerInfo.Height
198198 }
199-
200- m.savePeerInfo(peerInfo)
201199 }
202200 log.Info("bestHeight: ", bestHeight)
201+ m.savePeerInfos(peers.GetPeerInfos())
203202
204203 // TODO:
205204 // msg := struct{ msgs.BlockchainMessage }{&msgs.GetBlockMessage{Height: bestHeight + 1}}
--- a/toolbar/precog/monitor/stats.go
+++ b/toolbar/precog/monitor/stats.go
@@ -49,6 +49,13 @@ func (m *monitor) upSertNode(node *config.Node) error {
4949 }).FirstOrCreate(ormNode).Error
5050 }
5151
52+func (m *monitor) savePeerInfos(peerInfos []*peers.PeerInfo) error {
53+ for _, peerInfo := range peerInfos {
54+ m.savePeerInfo(peerInfo)
55+ }
56+ return nil
57+}
58+
5259 func (m *monitor) savePeerInfo(peerInfo *peers.PeerInfo) error {
5360 xPub := &chainkd.XPub{}
5461 if err := xPub.UnmarshalText([]byte(peerInfo.ID)); err != nil {
Show on old repository browser