Fix transaction attempt on non-recognised comments

This commit is contained in:
snugghash 2017-06-14 19:11:46 +05:30
parent 5e08f347e0
commit c88713159d
1 changed files with 6 additions and 4 deletions

View File

@ -40,10 +40,12 @@ app.post('/' + address.toString(), jsonParser, function(req, res, next){
var issueId = req.body.issue.id; var issueId = req.body.issue.id;
var namePosition = commentBody.search("@" + name); var namePosition = commentBody.search("@" + name);
// Store toAddress from commiteth // Store toAddress from commiteth
if (namePosition == -1 && req.body.comment.user.login == 'commiteth') { // TODO no existence check if (namePosition == -1 ) {
issueData[issueId] = {"toAddress": commentBody.substring(commentBody.search("Contract address:") + 18, commentBody.search("Contract address:") + 60)} if (req.body.comment.user.login == 'commiteth') { // TODO no existence check
console.log(issueData); issueData[issueId] = {"toAddress": commentBody.substring(commentBody.search("Contract address:") + 18, commentBody.search("Contract address:") + 60)}
return res.status(204); console.log(issueData);
return res.status(204);
}
} }
else { else {
var postNameWords = commentBody.substring(namePosition + 1 + name.length + 1).trim().split(' '); var postNameWords = commentBody.substring(namePosition + 1 + name.length + 1).trim().split(' ');