mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-13 07:23:46 +00:00
commit
75885b57eb
3 changed files with 4 additions and 7 deletions
|
|
@ -120,8 +120,7 @@ func (bs *BeaconStorage) Put(contentKey []byte, contentId []byte, content []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BeaconStorage) Radius() *uint256.Int {
|
func (bs *BeaconStorage) Radius() *uint256.Int {
|
||||||
// TODO
|
return storage.MaxDistance
|
||||||
panic("implement me")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BeaconStorage) getContentValue(contentId []byte) ([]byte, error) {
|
func (bs *BeaconStorage) getContentValue(contentId []byte) ([]byte, error) {
|
||||||
|
|
|
||||||
|
|
@ -38,10 +38,6 @@ const (
|
||||||
ORDER BY distance DESC`
|
ORDER BY distance DESC`
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
maxDistance = uint256.MustFromHex("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
|
|
||||||
)
|
|
||||||
|
|
||||||
var _ storage.ContentStorage = &ContentStorage{}
|
var _ storage.ContentStorage = &ContentStorage{}
|
||||||
var once sync.Once
|
var once sync.Once
|
||||||
|
|
||||||
|
|
@ -108,7 +104,7 @@ func NewHistoryStorage(config storage.PortalStorageConfig) (storage.ContentStora
|
||||||
storageCapacityInBytes: config.StorageCapacityMB * 1000000,
|
storageCapacityInBytes: config.StorageCapacityMB * 1000000,
|
||||||
log: log.New("history_storage"),
|
log: log.New("history_storage"),
|
||||||
}
|
}
|
||||||
hs.radius.Store(maxDistance)
|
hs.radius.Store(storage.MaxDistance)
|
||||||
err := hs.createTable()
|
err := hs.createTable()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ import (
|
||||||
|
|
||||||
var ErrContentNotFound = fmt.Errorf("content not found")
|
var ErrContentNotFound = fmt.Errorf("content not found")
|
||||||
|
|
||||||
|
var MaxDistance = uint256.MustFromHex("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
|
||||||
|
|
||||||
type ContentType byte
|
type ContentType byte
|
||||||
|
|
||||||
type ContentKey struct {
|
type ContentKey struct {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue