From 17dd44862ff2a8e0b4086bd528aca172f43de5bd Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 16 Sep 2024 16:21:50 +0000 Subject: [PATCH] Always use configured voting account when mixing The comments suggested that this was the intended behavior, but the voting account option was only being considered when UseVotingAccount (allowing the option to be used in non-mixing situations) was true, and mixed ticketbuying was not setting this value. --- wallet/createtx.go | 14 +++++++------- wallet/wallet.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wallet/createtx.go b/wallet/createtx.go index 28efd1d1b..e44c01758 100644 --- a/wallet/createtx.go +++ b/wallet/createtx.go @@ -1510,13 +1510,13 @@ func (w *Wallet) purchaseTickets(ctx context.Context, op errors.Op, var addrVote stdaddr.StakeAddress - // If req.UseVotingAccount is true, derive the submission - // script's address from the voting account. This is intended - // to be used with a special account type. The signing address - // for the same index is saved to the database. That address is - // later used to sign messages sent to a vspd related to this - // ticket. - if req.UseVotingAccount { + // If req.Mixing or req.UseVotingAccount is true, derive the + // submission script's address from the voting account. This + // is intended to be used with a special account type. The + // signing address for the same index is saved to the + // database. That address is later used to sign messages sent + // to a vspd related to this ticket. + if req.Mixing || req.UseVotingAccount { var idx uint32 addrVote, idx, err = stakeAddrFunc(op, req.VotingAccount, 1) if err != nil { diff --git a/wallet/wallet.go b/wallet/wallet.go index f5c090a7d..9a2200e2d 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -1545,7 +1545,7 @@ type PurchaseTicketsRequest struct { SourceAccount uint32 MinConf int32 Expiry int32 - VotingAccount uint32 // Used when Mixing == true + VotingAccount uint32 // Used when Mixing == true || UseVotingAccount == true UseVotingAccount bool // Forces use of supplied voting account. DontSignTx bool