Skip to content

Commit

Permalink
Validate the address provided to --ticketaddress
Browse files Browse the repository at this point in the history
  • Loading branch information
dajohi committed Mar 4, 2016
1 parent 8213003 commit 9f1b598
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,17 @@ func loadConfig() (*config, []string, error) {
return nil, nil, err
}

if len(cfg.TicketAddress) != 0 {
_, err := dcrutil.DecodeAddress(cfg.TicketAddress, activeNet.Params)
if err != nil {
str := "%s: ticketaddress '%s' failed to decode: %v"
err := fmt.Errorf(str, funcName, cfg.TicketAddress, err)
fmt.Fprintln(os.Stderr, err)
fmt.Fprintln(os.Stderr, usageMessage)
return nil, nil, err
}
}

if cfg.RPCConnect == "" {
cfg.RPCConnect = net.JoinHostPort("localhost", activeNet.RPCClientPort)
}
Expand Down

0 comments on commit 9f1b598

Please sign in to comment.