|
|
@ -233,19 +233,18 @@ func (s *Service) GetExplorerAddress(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
|
|
|
|
|
|
|
data := &Data{} |
|
|
|
data := &Data{} |
|
|
|
if id == "" { |
|
|
|
if id == "" { |
|
|
|
json.NewEncoder(w).Encode(data.Address) |
|
|
|
json.NewEncoder(w).Encode(nil) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
db := s.storage.GetDB() |
|
|
|
db := s.storage.GetDB() |
|
|
|
bytes, err := db.Get([]byte(key)) |
|
|
|
bytes, err := db.Get([]byte(key)) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
json.NewEncoder(w).Encode(data.Address) |
|
|
|
json.NewEncoder(w).Encode(nil) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
var address Address |
|
|
|
var address Address |
|
|
|
if err = rlp.DecodeBytes(bytes, &address); err != nil { |
|
|
|
if err = rlp.DecodeBytes(bytes, &address); err != nil { |
|
|
|
fmt.Println(err) |
|
|
|
json.NewEncoder(w).Encode(nil) |
|
|
|
json.NewEncoder(w).Encode(data.Address) |
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
data.Address = address |
|
|
|
data.Address = address |
|
|
|