Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 9 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ type config struct {

type ticketBuyerOptions struct {
BalanceToMaintainAbsolute *cfgutil.AmountFlag `long:"balancetomaintainabsolute" description:"Amount of funds to keep in wallet when purchasing tickets"`
BalanceToMaintain *cfgutil.AmountFlag `long:"balancetomaintain" description:"Amount of funds to keep in wallet when purchasing tickets"`
Limit uint `long:"limit" description:"Buy no more than specified number of tickets per block"`
VotingAccount string `long:"votingaccount" description:"Account used to derive addresses specifying voting rights"`
}
Expand Down Expand Up @@ -380,8 +381,8 @@ func loadConfig(ctx context.Context) (*config, []string, error) {

// Ticket Buyer Options
TBOpts: ticketBuyerOptions{
BalanceToMaintainAbsolute: cfgutil.NewAmountFlag(defaultBalanceToMaintainAbsolute),
Limit: defaultTicketbuyerLimit,
BalanceToMaintain: cfgutil.NewAmountFlag(defaultBalanceToMaintainAbsolute),
Limit: defaultTicketbuyerLimit,
},

VSPOpts: vspOptions{
Expand Down Expand Up @@ -437,6 +438,12 @@ func loadConfig(ctx context.Context) (*config, []string, error) {
configFileError = err
}

if cfg.TBOpts.BalanceToMaintainAbsolute != nil {
log.Warn("The 'ticketbuyer.balancetomaintainabsolute' attribute in the config file is outdated. You should update it to 'ticketbuyer.balancetomaintain'")
} else {
cfg.TBOpts.BalanceToMaintainAbsolute = cfg.TBOpts.BalanceToMaintain
}

// Parse command line options again to ensure they take precedence.
remainingArgs, err := parser.Parse()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion sample-dcrwallet.conf
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
; ------------------------------------------------------------------------------

; Amount of funds to keep in wallet when stake mining
; ticketbuyer.balancetomaintainabsolute=0
; ticketbuyer.balancetomaintain=0

[VSP Options]

Expand Down