• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: Commit

Golang implemented sidechain for Bytom


Commit MetaInfo

Revisionf2d2a4460f20dc36962e58b51bc860dda43b5a1d (tree)
Time2019-08-21 12:20:33
AuthorHAOYUatHZ <haoyu@prot...>
CommiterHAOYUatHZ

Log Message

clean

Change Summary

Incremental Difference

--- a/toolbar/precog/monitor/stats.go
+++ b/toolbar/precog/monitor/stats.go
@@ -50,15 +50,17 @@ func (m *monitor) upSertNode(node *config.Node) error {
5050 }
5151
5252 func (m *monitor) savePeerInfos(peerInfos []*peers.PeerInfo) error {
53- dbTx := m.db.Begin()
5453 for _, peerInfo := range peerInfos {
54+ dbTx := m.db.Begin()
5555 if err := m.savePeerInfo(dbTx, peerInfo); err != nil {
56+ log.Error(err)
5657 dbTx.Rollback()
57- return err
58+ } else {
59+ dbTx.Commit()
5860 }
5961 }
6062
61- return dbTx.Commit().Error
63+ return nil
6264 }
6365
6466 func (m *monitor) savePeerInfo(dbTx *gorm.DB, peerInfo *peers.PeerInfo) error {
Show on old repository browser