|
@ -159,26 +159,16 @@ func claimHandler(w http.ResponseWriter, req *http.Request, op string) { |
|
|
if len(c.ProofData) < 1 { |
|
|
if len(c.ProofData) < 1 { |
|
|
resp.Error = true |
|
|
resp.Error = true |
|
|
resp.Response = "proofData not provided" |
|
|
resp.Response = "proofData not provided" |
|
|
reply(&resp, w) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
var validProof bool |
|
|
|
|
|
validProof, err = T.CheckProof([]byte(c.ClaimData), c.ProofData) |
|
|
|
|
|
if validProof { |
|
|
|
|
|
resp.Response = "valid" |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
resp.Response = "invalid" |
|
|
|
|
|
|
|
|
validProof, _ := T.CheckProof([]byte(c.ClaimData), c.ProofData) |
|
|
|
|
|
if validProof { |
|
|
|
|
|
resp.Response = "valid" |
|
|
|
|
|
} else { |
|
|
|
|
|
resp.Response = "invalid" |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
resp.Error = true |
|
|
|
|
|
resp.Response = fmt.Sprint(err) |
|
|
|
|
|
log.Print(err) |
|
|
|
|
|
reply(&resp, w) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
reply(&resp, w) |
|
|
reply(&resp, w) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|