Major refactoring of the code base into Backend structure. Increase version number to Alpha 6 to prepare for the upcoming release.

This commit is contained in:
Kleissner
2021-12-29 05:29:34 +01:00
parent ade13d6422
commit f2c344dc96
40 changed files with 642 additions and 649 deletions

View File

@@ -11,7 +11,6 @@ import (
"fmt"
"time"
"github.com/PeernetOfficial/core"
"github.com/PeernetOfficial/core/blockchain"
)
@@ -20,7 +19,7 @@ func (api *WebapiInstance) dispatchSearch(input SearchRequest) (job *SearchJob)
Filter := input.ToSearchFilter()
// create the search job
job = CreateSearchJob(Timeout, input.MaxResults, Filter)
job = CreateSearchJob(api.backend, Timeout, input.MaxResults, Filter)
// todo: create actual search clients!
job.Status = SearchStatusLive
@@ -56,10 +55,10 @@ resultLoop:
}
}
if bytes.Equal(file.NodeID, core.SelfNodeID()) {
if bytes.Equal(file.NodeID, job.backend.SelfNodeID()) {
// Indicates data from the current user.
file.Tags = append(file.Tags, blockchain.TagFromNumber(blockchain.TagSharedByCount, 1))
} else if peer := core.NodelistLookup(file.NodeID); peer != nil {
} else if peer := job.backend.NodelistLookup(file.NodeID); peer != nil {
// add the tags 'Shared By Count' and 'Shared By GeoIP'
file.Tags = append(file.Tags, blockchain.TagFromNumber(blockchain.TagSharedByCount, 1))
if latitude, longitude, valid := api.Peer2GeoIP(peer); valid {