fix: pass both StorageLocationTypeFull and StorageLocationTypeFile

This commit is contained in:
Derrick Hammer 2024-01-09 11:43:33 -05:00
parent 26e0a4c9df
commit 2622f2b9d0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 2 additions and 2 deletions

View File

@ -27,4 +27,5 @@ type P2PService interface {
SendHashRequest(hash *encoding.Multihash, kinds []types.StorageLocationType) error SendHashRequest(hash *encoding.Multihash, kinds []types.StorageLocationType) error
UpVote(nodeId *encoding.NodeId) error UpVote(nodeId *encoding.NodeId) error
DownVote(nodeId *encoding.NodeId) error DownVote(nodeId *encoding.NodeId) error
NodeId() *encoding.NodeId
} }

View File

@ -15,7 +15,6 @@ import (
"github.com/vmihailenco/msgpack/v5" "github.com/vmihailenco/msgpack/v5"
bolt "go.etcd.io/bbolt" bolt "go.etcd.io/bbolt"
"go.uber.org/zap" "go.uber.org/zap"
"log"
"sync" "sync"
"time" "time"
) )
@ -213,7 +212,7 @@ func (n *NodeImpl) AddStorageLocation(hash *encoding.Multihash, nodeId *encoding
func (n *NodeImpl) DownloadBytesByHash(hash *encoding.Multihash) ([]byte, error) { func (n *NodeImpl) DownloadBytesByHash(hash *encoding.Multihash) ([]byte, error) {
// Initialize the download URI provider // Initialize the download URI provider
dlUriProvider := storage.NewStorageLocationProvider(n, hash) dlUriProvider := storage.NewStorageLocationProvider(n, hash, types.StorageLocationTypeFull, types.StorageLocationTypeFile)
err := dlUriProvider.Start() err := dlUriProvider.Start()
if err != nil { if err != nil {
return nil, err return nil, err