Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion internal/webapi/setvotechoices.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2024 The Decred developers
// Copyright (c) 2020-2026 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

Expand Down Expand Up @@ -108,13 +108,15 @@ func (w *WebAPI) setVoteChoices(c *gin.Context) {
w.log.Warnf("%s: Invalid treasury policy (clientIP=%s, ticketHash=%s): %v",
funcName, c.ClientIP(), ticket.Hash, err)
w.sendErrorWithMsg(err.Error(), types.ErrInvalidVoteChoices, c)
return
}

err = validTSpendPolicy(request.TSpendPolicy)
if err != nil {
w.log.Warnf("%s: Invalid tspend policy (clientIP=%s, ticketHash=%s): %v",
funcName, c.ClientIP(), ticket.Hash, err)
w.sendErrorWithMsg(err.Error(), types.ErrInvalidVoteChoices, c)
return
}

// Update voting preferences in the database before updating the wallets. DB
Expand Down
Loading