From 0a8e838cd2c2ab369fe9e937b414b97613a400ec Mon Sep 17 00:00:00 2001 From: Akilan Date: Mon, 27 Mar 2023 15:49:42 +0100 Subject: [PATCH] added comments --- webapi/Merge directory.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapi/Merge directory.go b/webapi/Merge directory.go index 5639f6b..ec6f0a3 100644 --- a/webapi/Merge directory.go +++ b/webapi/Merge directory.go @@ -23,7 +23,7 @@ func (api *WebapiInstance) apiMergeDirectory(w http.ResponseWriter, r *http.Requ limit = 100 } // ID fields for results for a specific node ID. - NodeId, _ := DecodeBlake3Hash(r.Form.Get("node")) + //NodeId, _ := DecodeBlake3Hash(r.Form.Get("node")) hash, _ := DecodeBlake3Hash(r.Form.Get("hash")) fileType, err := strconv.Atoi(r.Form.Get("type")) @@ -31,14 +31,14 @@ func (api *WebapiInstance) apiMergeDirectory(w http.ResponseWriter, r *http.Requ fileType = -1 } - result := api.ExploreFileSharedByNodeThatSharedSimilarFile(fileType, limit, offset, NodeId, hash, true) + result := api.ExploreFileSharedByNodeThatSharedSimilarFile(fileType, limit, offset, hash, true) EncodeJSON(api.Backend, w, r, result) } // ExploreFileSharedByNodeThatSharedSimilarFile lists files shared by a nodes which share the same file as a common point // Currently this is a greedy search and requires work for optimization -func (api *WebapiInstance) ExploreFileSharedByNodeThatSharedSimilarFile(fileType int, limit, offset int, nodeID []byte, hash []byte, nodeIDState bool) *SearchResultMergedDirectory { +func (api *WebapiInstance) ExploreFileSharedByNodeThatSharedSimilarFile(fileType int, limit, offset int, hash []byte, nodeIDState bool) *SearchResultMergedDirectory { // lookup all NodeID blockchains which have the similar hash // do a search to get all the node IDs sharing the particular file NodeIDs, _ := api.Backend.SearchIndex.SearchNodeIDBasedOnHash(hash)