From f86a110ee6a4bdc223660088c0cf0ed8fb774297 Mon Sep 17 00:00:00 2001 From: jholdstock Date: Tue, 14 Apr 2026 09:57:17 +0800 Subject: [PATCH] setVoteChoices: Missing return on validation error --- internal/webapi/setvotechoices.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/webapi/setvotechoices.go b/internal/webapi/setvotechoices.go index c2453586..5cb939e5 100644 --- a/internal/webapi/setvotechoices.go +++ b/internal/webapi/setvotechoices.go @@ -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. @@ -108,6 +108,7 @@ 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) @@ -115,6 +116,7 @@ func (w *WebAPI) setVoteChoices(c *gin.Context) { 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