瀏覽代碼

Merge pull request #1317 from LK4D4/no_debug_on_empty

networkdb: do nothing in bulkSync if nodes is empty
Alessandro Boch 9 年之前
父節點
當前提交
918c6052ae
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      libnetwork/networkdb/cluster.go

+ 4 - 0
libnetwork/networkdb/cluster.go

@@ -360,6 +360,10 @@ func (nDB *NetworkDB) bulkSync(nid string, nodes []string, all bool) ([]string,
 		nodes = nDB.mRandomNodes(1, nodes)
 	}
 
+	if len(nodes) == 0 {
+		return nil, nil
+	}
+
 	logrus.Debugf("%s: Initiating bulk sync with nodes %v", nDB.config.NodeName, nodes)
 	var err error
 	var networks []string