mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-18 11:17:49 +01:00
added filter to search based on NodeID
This commit is contained in:
@@ -98,6 +98,26 @@ func (api *WebapiInstance) GreedySearchMergeDirection(nodeID *[][]byte, fileType
|
||||
|
||||
var filesFromPeer uint64
|
||||
|
||||
//var Name string
|
||||
//
|
||||
//ProfileNameFound := false
|
||||
//
|
||||
//// First iteration of the entire blockchain to search for the profile
|
||||
//// image and Username of the user
|
||||
//for blockN1 := peer.BlockchainHeight - 1; blockN1 > 0; blockN1-- {
|
||||
// blockDecoded, _, found, _ := api.Backend.ReadBlock(peer.PublicKey, peer.BlockchainVersion, blockN1)
|
||||
// if !found {
|
||||
// continue
|
||||
// }
|
||||
// // Adding profile image and Username to the output
|
||||
// for raw := range blockDecoded.Block.RecordsRaw {
|
||||
// if blockDecoded.Block.RecordsRaw[raw].Type == blockchain.ProfileName && !ProfileNameFound {
|
||||
// Name = string(blockDecoded.Block.RecordsRaw[raw].Data[:])
|
||||
// ProfileNameFound = true
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
// decode blocks from top down
|
||||
for blockN := peer.BlockchainHeight - 1; blockN > 0; blockN-- {
|
||||
blockDecoded, _, found, _ := api.Backend.ReadBlock(peer.PublicKey, peer.BlockchainVersion, blockN)
|
||||
@@ -114,6 +134,8 @@ func (api *WebapiInstance) GreedySearchMergeDirection(nodeID *[][]byte, fileType
|
||||
file.Tags = append(file.Tags, blockchain.TagFromText(blockchain.TagSharedByGeoIP, sharedByGeoIP))
|
||||
}
|
||||
|
||||
//file.Username = Name
|
||||
|
||||
// if both the hashes match
|
||||
if bytes.Equal(file.Hash, hash) {
|
||||
// set the Tags needed for the filter parameter
|
||||
|
||||
Reference in New Issue
Block a user