fix ranging for proofs

This commit is contained in:
Xuu 2020-10-22 21:28:43 -06:00
parent c1fc005c78
commit 1a88e47181
Signed by: xuu
GPG Key ID: 8B3B0604F164E04F

View File

@ -113,7 +113,8 @@ func (s *identity) get(w http.ResponseWriter, r *http.Request) {
for i := range entity.Proofs {
q.Run(ProofKey(entity.Proofs[i]), func(q promise.Q) {
proof := NewProof(entity.Proofs[i])
key := q.Key().(ProofKey)
proof := NewProof(string(key))
q.Resolve(proof)
})
@ -153,11 +154,14 @@ func (s *identity) get(w http.ResponseWriter, r *http.Request) {
gotProofs = true
if len(page.Entity.Proofs) > 0 {
proofs := make(Proofs, len(page.Entity.Proofs))
for _, p := range page.Entity.Proofs {
for i := range page.Entity.Proofs {
p := page.Entity.Proofs[i]
proofs[p] = NewProof(p)
if s, ok := s.cache.Get(ProofKey(p)); ok {
proofs[p] = s.Value().(*Proof)
} else {
log.Info("Missing proof", p)
gotProofs = false
}
}