add missing amt validations

This commit is contained in:
kiwiidb
2022-06-10 10:20:54 +02:00
parent 5a35d7ce9d
commit 22a788e153
2 changed files with 2 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ func AddInvoice(c echo.Context, svc *service.LndhubService, userID int64) error
}
amount, err := svc.ParseInt(body.Amount)
if err != nil {
if err != nil || amount < 0 {
return c.JSON(http.StatusBadRequest, responses.BadArgumentsError)
}
c.Logger().Infof("Adding invoice: user_id:%v memo:%s value:%v description_hash:%s", userID, body.Memo, amount, body.DescriptionHash)