- returns the BIP70 network string
- use that new function in the core and GUI code and remove unused code and functions
add NetworkIDString() to chainparams #4326
pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:clientmodel_networkname changing 8 files +14 −33-
Diapolo commented at 10:34 am on June 11, 2014: none
-
in src/qt/clientmodel.cpp: in 5a7cc2bef5 outdated
153+ if (networkId == CChainParams::MAIN) 154+ return "main"; 155+ else if (networkId == CChainParams::TESTNET) 156+ return "test"; 157+ else if (networkId == CChainParams::REGTEST) 158+ return "test";
laanwj commented at 12:07 pm on June 11, 2014:Shouldn’t this be “regtest”?
Diapolo commented at 12:38 pm on June 11, 2014:Indeed…in src/qt/clientmodel.cpp: in 5a7cc2bef5 outdated
143@@ -144,10 +144,16 @@ void ClientModel::updateAlert(const QString &hash, int status) 144 145 QString ClientModel::getNetworkName() const
laanwj commented at 12:10 pm on June 11, 2014:Please add a comment in the header that the value returned here is the BIP70 network string
Diapolo commented at 12:40 pm on June 11, 2014:See new comment in the header below.laanwj commented at 3:55 pm on June 11, 2014: memberHmm I just realize that we have the same information in getblockchaininfo, there it also uses the datadir name to identify the network. Not sure whether it’s nice to change the debug window now (or we should use the BIP70 naming in getblockchaininfo as well, which may make sense… ).Diapolo commented at 6:25 am on June 12, 2014: noneI could add a
NetworkIDToString()
function in chainparams, which will be theClientModel::getNetworkName()
code. I then also can remove the ClientModel from PaymentServer.Edit: See 2nd commit, that could be used instead, what do you think?
jtimon commented at 11:12 am on June 12, 2014: contributorYes, I would have used a string network id chainparam like it’s done in https://github.com/Diapolo/bitcoin/commit/dcca44115dfcafb38cc435679b40fde3c8179d19 I would mention the BIP 70 there in chainparams directly. But once that is done I don’t see the need to keep the ClientModel::getNetworkName() method with the ugly elif list.
You can just replace if (details.network() != clientModel->getNetworkName().toStdString()) with if (details.network() != Params().NetworkIDString())
and completely forget about my PaymentServer::mapNetworkIdToName and your ClientModel::getNetworkName. That’s what I would have done from the beginning if I wasn’t adviced against it. I would also replace getinfo’s (rpcmisc.cpp:76) and getmininginfo’s (rpcmining.cpp:271) “testnet” in favor of “network”, “mode” or something like that which would also call Params().NetworkIDString(), allowing us to also get rid of CChainParams::RPCisTestNet()
Diapolo commented at 11:14 am on June 12, 2014: noneI’m currently reworking this…add NetworkIDString() to chainparams
- returns the BIP70 network string - use that new function in the core and GUI code and remove unused code and functions
Diapolo renamed this:
[Qt] rework ClientModel::getNetworkName()
add NetworkIDString() to chainparams
on Jun 12, 2014Diapolo commented at 11:22 am on June 12, 2014: noneDone…laanwj commented at 11:24 am on June 12, 2014: memberSeems we have two equivalent pulls now…laanwj commented at 11:26 am on June 12, 2014: memberRight :) Code changes look OK to me, haven’t tested yet.jtimon commented at 11:37 am on June 12, 2014: contributorI created another PR (#4333) using https://github.com/jtimon/bitcoin/commit/f5ae6c98260fdd3c0ca203ce67c6467d9cdaea95 and making my other proposed change (removing chainparams::RPCisTestnet) on top of it.BitcoinPullTester commented at 11:41 am on June 12, 2014: noneAutomatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/f5ae6c98260fdd3c0ca203ce67c6467d9cdaea95 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.laanwj merged this on Jun 16, 2014laanwj closed this on Jun 16, 2014
laanwj referenced this in commit 807691ca96 on Jun 16, 2014Diapolo deleted the branch on Jun 17, 2014MarcoFalke locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 18:12 UTC
More mirrored repositories can be found on mirror.b10c.me