-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Rework network config settings #1389
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
Conversation
|
ACK Tangentially related: it would be nice to move as much code from init.cpp into net*.cpp as possible, with init.cpp only calling NetParseConfig() or somesuch. Maybe that would help with qt/optionsmodel.cpp long term maintenance. |
|
@jgarzik agree, I considered that, but wanted to postpone that until after tor hidden service support is merged, as that will extend the network config options further. |
|
@laanwj ack on the optionsmodel changes? After tor hidden service support is merged, the network option panel should be extended, I think, but for now, this should do. |
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.
Why does GetProxy have NET_IPV4 all over? do IPv6 proxies work?
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.
Internally, proxies can be selected separately for each network, and for hostname-based destination. The config and GUI right now are pinned to assume the IPv4 one is the only one, so they read NET_IPV4, and modify the NET_IPV4, NET_IPV6, and named ones simuitaneously.
It's just a temporary measure, I expect the GUI config panel will be extended with more proxy options, and for RPC maybe we can move to a "getnetconfig" command that returns this kind of information, including connected peers and some statistics?
|
updated |
|
As asked by @gavinandresen: the parameter interactions are now done using SoftSetBoolArg, instead of complex boolean formulas. Also added some comments. |
|
ACK on gui changes I wonder if "applyproxysettings" belongs in optionsmodel, though (or the ui |
|
Yes, and it is effectively duplicated code from init.cpp for now. That's why Jeff already suggested a common NetParseConfig somehwere - I think that's the right approach. |
|
ACK. Lightly tested on OSX. |
|
@sipa This introduces a small display bug in the Qt GUI, it displays "localhost" as default Proxy-IP and it seems hostnames are not allowed there. If I enable the proxy and click apply it is changed to 127.0.0.1. I think this happens in CNetAddr::ToStringIP(), which resolves 127.0.0.1 to "localhost", which is true, but currently not allowed in the GUI input field or in this line: https://github.com/bitcoin/bitcoin/pull/1389/files#L9R151 |
Print command line configuration to debug.log
2be6f7b [GUI] MasterNodeWizardDialog: fix RegTestNet default port 51476 (random-zebra) 68a92f9 [GUI] MasternodeWidget: unlock collateral output coin after MN deletion (random-zebra) bdb13c8 [GUI][Model] Enforce required depth for mn collaterals (random-zebra) 1c197d2 [GUI] MasternodeWizard: lock collateral output coin after MN creation (random-zebra) d56a8f8 [Trivial] Styling: spaces and brackets (random-zebra) Pull request description: This PR fixes some issue with the masternode GUI interaction. **1)** __MasternodeWizard: lock collateral output after MN creation.__ The masternode configuration file is only read during init, and then the `COutPoint`s relative to the collateral of each entry is locked for spending. Thus, after creating a MN controller with the wizard, the collateral remains unlocked until the wallet is restarted, and therefore could be potentially spent or staked. **2)** __Enforce required depth for mn collaterals__ The masternode collateral transaction requires at least 15 confirmations before the mn broadcast can be considered valid. Properly inform the user after creating a controller with the wizard, and when trying to start a masternode not yet confirmed. **3)** __MasternodeWidget: unlock collateral output coin after MN deletion__ Mirrors (1). Unlock the collateral utxo when the masternode is deleted, otherwise it remains locked until wallet restart. **4)** __MasterNodeWizardDialog: fix RegTestNet default port__ RegTest was using the fixed port value of TestNet instead of the default 51476. ACKs for top commit: Fuzzbawls: utACK 2be6f7b furszy: code ACK 2be6f7b. Tree-SHA512: a0d9a51b548dbf4d808ebdbd6ad696fc05f9d59c8768dafc7985e7753351ec1094c975c80c5b4cf7b788c45344432d5dfc241cca089236cdce904d1429db9608
…ature collateral 7830c17 [BUG] Prevent StartAll from starting mns with immature collateral (random-zebra) Pull request description: Extends the fix of bitcoin#1389 (point 2) also to `startAll` (not only `startAlias`). Additional ref: PIVX-Project#1226 ACKs for top commit: Fuzzbawls: utACK 7830c17 furszy: utACK 7830c17 Tree-SHA512: 74798a075aab71d27b3e65827e625eb876ddc7d0a0a6a641864aa5bfa8bc720ee8200020dc497b03e436b6e4df25bef09955397dbdc7f267cdbd3f5781b08223
Rework network config settings according to the specification in https://gist.github.com/2763381.
The network base does no longer call GetArg directly. Instead, everything happens through a few globals and the SetProxy/SetNameProxy methods. These are called in init.cpp:AppInit2, and in Bitcoin-Qt's optionsmodel.cpp.