fix ranging for proofs
This commit is contained in:
parent
c1fc005c78
commit
1a88e47181
|
@ -113,7 +113,8 @@ func (s *identity) get(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
for i := range entity.Proofs {
|
for i := range entity.Proofs {
|
||||||
q.Run(ProofKey(entity.Proofs[i]), func(q promise.Q) {
|
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)
|
q.Resolve(proof)
|
||||||
})
|
})
|
||||||
|
@ -153,11 +154,14 @@ func (s *identity) get(w http.ResponseWriter, r *http.Request) {
|
||||||
gotProofs = true
|
gotProofs = true
|
||||||
if len(page.Entity.Proofs) > 0 {
|
if len(page.Entity.Proofs) > 0 {
|
||||||
proofs := make(Proofs, len(page.Entity.Proofs))
|
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)
|
proofs[p] = NewProof(p)
|
||||||
if s, ok := s.cache.Get(ProofKey(p)); ok {
|
if s, ok := s.cache.Get(ProofKey(p)); ok {
|
||||||
proofs[p] = s.Value().(*Proof)
|
proofs[p] = s.Value().(*Proof)
|
||||||
} else {
|
} else {
|
||||||
|
log.Info("Missing proof", p)
|
||||||
gotProofs = false
|
gotProofs = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user