-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: Add --whitelist option #352
Conversation
config.go
Outdated
@@ -101,6 +101,7 @@ type config struct { | |||
DisableBanning bool `long:"nobanning" description:"Disable banning of misbehaving peers"` | |||
BanDuration time.Duration `long:"banduration" description:"How long to ban misbehaving peers. Valid time units are {s, m, h}. Minimum 1 second"` | |||
BanThreshold uint32 `long:"banthreshold" description:"Maximum allowed ban score before disconnecting and banning misbehaving peers."` | |||
Whitelists []string `long:"whitelist" description:"Add a network that will not be banned. (eg. 192.168.1.1/32)"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only works with CIDR or can just an IP address also be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work with IPv6 too? |
@jrick CIDR only the way it is now. I could add single IP support if desired. |
@cjepson yes |
@dajohi Would prefer single IP support for ease of use. |
This will be synced with btcd - btcsuite/btcd#769 |
@dajohi so if this is planned on going in as part of a btcd sync after the similar commit goes into btcd maybe this PR should be closed (since it should not be accepted directly), right? |
leaving open til the code is in dcrd |
Still leaving open for upcoming btcd sync that should include this. |
Since we are backporting features we want from btcd instead of waiting for the sync, i'm ok with this going in. It has merge conflicts however and needs a rebase. |
The upstream version is waiting for updates as well. This is not ready to go in as is. |
@jrick single ip support is in btcsuite/btcd#769 |
All concerns have been addressed. |
The whitelist option is used to specify networks that will not be
banned.
Fixes #351