mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
swarm/storage: extract keySchema
This commit is contained in:
parent
9fc36171d0
commit
ec17cab926
1 changed files with 3 additions and 2 deletions
|
|
@ -61,6 +61,7 @@ var (
|
|||
keyDataIdx = []byte{4}
|
||||
keyData = byte(6)
|
||||
keyDistanceCnt = byte(7)
|
||||
keySchema = byte(8)
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -734,7 +735,7 @@ func (s *LDBStore) GetSchema() (string, error) {
|
|||
s.lock.Lock()
|
||||
defer s.lock.Unlock()
|
||||
|
||||
data, err := s.db.Get([]byte(`schema`))
|
||||
data, err := s.db.Get(keySchema)
|
||||
if err != nil {
|
||||
if err == leveldb.ErrNotFound {
|
||||
return "", nil
|
||||
|
|
@ -749,7 +750,7 @@ func (s *LDBStore) PutSchema(schema string) error {
|
|||
s.lock.Lock()
|
||||
defer s.lock.Unlock()
|
||||
|
||||
return s.db.Put([]byte(`schema`), []byte(schema))
|
||||
return s.db.Put(keySchema, []byte(schema))
|
||||
}
|
||||
|
||||
func (s *LDBStore) Get(_ context.Context, addr Address) (chunk Chunk, err error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue