swarm/api: move debug line to avoid panic

This commit is contained in:
Anton Evangelatov 2018-04-27 00:24:14 +02:00
parent 8e857ad4bf
commit 2914a89e11

View file

@ -321,9 +321,9 @@ func (self *Api) Get(key storage.Key, path string) (reader *storage.LazyChunkRea
log.Debug("trie getting entry", "key", key, "path", path) log.Debug("trie getting entry", "key", key, "path", path)
entry, _ := trie.getEntry(path) entry, _ := trie.getEntry(path)
log.Debug("trie got entry", "key", key, "path", path, "entry.Hash", entry.Hash)
if entry != nil { if entry != nil {
log.Debug("trie got entry", "key", key, "path", path, "entry.Hash", entry.Hash)
// we want to be able to serve Mutable Resource Updates transparently using the bzz:// scheme // we want to be able to serve Mutable Resource Updates transparently using the bzz:// scheme
// //
// we use a special manifest hack for this purpose, which is pathless and where the resource root key // we use a special manifest hack for this purpose, which is pathless and where the resource root key
@ -337,6 +337,7 @@ func (self *Api) Get(key storage.Key, path string) (reader *storage.LazyChunkRea
return nil, entry.ContentType, http.StatusOK, &ErrResourceReturn{entry.Hash} return nil, entry.ContentType, http.StatusOK, &ErrResourceReturn{entry.Hash}
} }
key = common.Hex2Bytes(entry.Hash) key = common.Hex2Bytes(entry.Hash)
log.Debug("trie key", "key", key)
status = entry.Status status = entry.Status
if status == http.StatusMultipleChoices { if status == http.StatusMultipleChoices {
apiGetHttp300.Inc(1) apiGetHttp300.Inc(1)