diff --git a/config.go b/config.go index 7a1eeed5e..eeee34e43 100644 --- a/config.go +++ b/config.go @@ -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"` } @@ -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{ @@ -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 { diff --git a/sample-dcrwallet.conf b/sample-dcrwallet.conf index e2ec3d3ba..a89b3f30a 100644 --- a/sample-dcrwallet.conf +++ b/sample-dcrwallet.conf @@ -237,7 +237,7 @@ ; ------------------------------------------------------------------------------ ; Amount of funds to keep in wallet when stake mining -; ticketbuyer.balancetomaintainabsolute=0 +; ticketbuyer.balancetomaintain=0 [VSP Options]