Skip to content

cmd/utils: Disallow --lightserv in light mode#15514

Merged
karalabe merged 3 commits into
ethereum:masterfrom
tsarpaul:master
Nov 24, 2017
Merged

cmd/utils: Disallow --lightserv in light mode#15514
karalabe merged 3 commits into
ethereum:masterfrom
tsarpaul:master

Conversation

@tsarpaul
Copy link
Copy Markdown
Contributor

@GitCop
Copy link
Copy Markdown

GitCop commented Nov 18, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: 93cf78078e57f29145dd9666fb88afa5dfd753fe
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@tsarpaul tsarpaul changed the title Disallow --lightserv in light mode cmd/utils: Disallow --lightserv in light mode Nov 18, 2017
@GitCop
Copy link
Copy Markdown

GitCop commented Nov 18, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: 93cf78078e57f29145dd9666fb88afa5dfd753fe

  • Commits must be prefixed with the package(s) they modify

  • Commit: 2f86c1d69d841723e012381f0c53ea940a07fb44

  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

Copy link
Copy Markdown
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, just a couple of polishes and it's good to go.

Comment thread cmd/utils/flags.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion, instead of nesting when the condition holds, let's continue when it doens't hold. This reduces the nesting depth of the entire code by one level:

flag, ok := arg.(cli.Flag)
if !ok {
	continue;
}

Comment thread cmd/utils/flags.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a panic here would be better. It shouts louder that something was coded wrong:

panic("unsupported flag argument type")

@karalabe karalabe added this to the 1.8.0 milestone Nov 23, 2017
@GitCop
Copy link
Copy Markdown

GitCop commented Nov 24, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: ce45110

  • Commits must be prefixed with the package(s) they modify

  • Commit: 642612c

  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@GitCop
Copy link
Copy Markdown

GitCop commented Nov 24, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: ce45110

  • Commits must be prefixed with the package(s) they modify

  • Commit: 642612c

  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@karalabe karalabe merged commit e4c9fd2 into ethereum:master Nov 24, 2017
@rkeene
Copy link
Copy Markdown

rkeene commented Mar 19, 2018

This change appears to disallow all use of --syncmode with --lightserv.

$ geth --syncmode="full" --port="30303" --lightserv=50 --cache=4096 --maxpeers=128
Fatal: Flags --lightserv, --syncmode can't be used at the same time

Due to the change here:

checkExclusive(ctx, LightServFlag, SyncModeFlag, "light")

Since checkExclusive does not discard the option from matching with respect to the string argument (the string argument, "light", only affects the formatting of the error message)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants