mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-20 11:57:51 +01:00
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:
11
DHT Store.go
11
DHT Store.go
@@ -11,19 +11,16 @@ import (
|
||||
"github.com/PeernetOfficial/core/store"
|
||||
)
|
||||
|
||||
// dhtStore contains all key-value data served via DHT
|
||||
var dhtStore store.Store
|
||||
|
||||
// TODO: Via descriptors, files stored by other peers
|
||||
|
||||
func initStore() {
|
||||
dhtStore = store.NewMemoryStore()
|
||||
func (backend *Backend) initStore() {
|
||||
backend.dhtStore = store.NewMemoryStore()
|
||||
}
|
||||
|
||||
// announcementGetData returns data for an announcement
|
||||
func announcementGetData(hash []byte) (stored bool, data []byte) {
|
||||
func (peer *PeerInfo) announcementGetData(hash []byte) (stored bool, data []byte) {
|
||||
// TODO: Create RetrieveIfSize to prevent files larger than EmbeddedFileSizeMax from being loaded
|
||||
data, found := dhtStore.Get(hash)
|
||||
data, found := peer.Backend.dhtStore.Get(hash)
|
||||
if !found {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user