Add missing error handling to /getfeeaddress.

Failing to generate a fee address for a ticket is a critical error, and should be handled as such.
This commit is contained in:
Jamie Holdstock 2021-04-30 10:19:47 +01:00 committed by Jamie Holdstock
parent b0521251e4
commit 391e436a71

View File

@ -1,4 +1,4 @@
// Copyright (c) 2020 The Decred developers // Copyright (c) 2020-2021 The Decred developers
// Use of this source code is governed by an ISC // Use of this source code is governed by an ISC
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
@ -169,6 +169,8 @@ func feeAddress(c *gin.Context) {
newAddress, newAddressIdx, err := getNewFeeAddress(db, addrGen) newAddress, newAddressIdx, err := getNewFeeAddress(db, addrGen)
if err != nil { if err != nil {
log.Errorf("%s: getNewFeeAddress error (ticketHash=%s): %v", funcName, ticketHash, err) log.Errorf("%s: getNewFeeAddress error (ticketHash=%s): %v", funcName, ticketHash, err)
sendError(errInternalError, c)
return
} }
now := time.Now() now := time.Now()