diff --git a/internal/rpc/jsonrpc/methods.go b/internal/rpc/jsonrpc/methods.go index 53b17f5c8..e0c8f35b1 100644 --- a/internal/rpc/jsonrpc/methods.go +++ b/internal/rpc/jsonrpc/methods.go @@ -4687,6 +4687,18 @@ func (s *Server) setVoteChoice(ctx context.Context, icmd any) (any, error) { func (s *Server) updateVSPVoteChoices(ctx context.Context, w *wallet.Wallet, ticketHash *chainhash.Hash, choices map[string]string, tspendPolicy map[string]string, treasuryPolicy map[string]string) error { + // Ensure empty (as opposed to nil) choices on every category (required + // by the contract of the VSP API). + if choices == nil { + choices = map[string]string{} + } + if tspendPolicy == nil { + tspendPolicy = map[string]string{} + } + if treasuryPolicy == nil { + treasuryPolicy = map[string]string{} + } + if ticketHash != nil { vspHost, err := w.VSPHostForTicket(ctx, ticketHash) if err != nil { diff --git a/wallet/wallet.go b/wallet/wallet.go index 0f9dda294..2fd9bde22 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -408,7 +408,7 @@ func (w *Wallet) AgendaChoices(ctx context.Context, ticketHash *chainhash.Hash) const op errors.Op = "wallet.AgendaChoices" version, deployments := CurrentAgendas(w.chainParams) if len(deployments) == 0 { - return nil, 0, nil + return map[string]string{}, 0, nil } choices = make(map[string]string, len(deployments))