Skip to content

Conversation

@Diapolo
Copy link

@Diapolo Diapolo commented Jun 11, 2014

  • returns the BIP70 network string
  • use that new function in the core and GUI code and remove unused code
    and functions

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be "regtest"?

Copy link
Author

Choose a reason for hiding this comment

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

Indeed...

@laanwj
Copy link
Member

laanwj commented Jun 11, 2014

Hmm 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
Copy link
Author

Diapolo commented Jun 12, 2014

@laanwj IMHO it should be consistent all over the place and if we want to compare the strings it would be best to use ones that can be compared, so I vote for the BIP70 naming.

@Diapolo
Copy link
Author

Diapolo commented Jun 12, 2014

I could add a NetworkIDToString() function in chainparams, which will be the ClientModel::getNetworkName() code. I then also can remove the ClientModel from PaymentServer.

Edit: See 2nd commit, that could be used instead, what do you think?

@laanwj
Copy link
Member

laanwj commented Jun 12, 2014

Yes - I was initially against putting the BIP70 names on ChainParams as it was seemingly a UI-only thing @jtimon but with the field in getblockchaininfo it makes sense to move it to the core anyway.

@jtimon
Copy link
Contributor

jtimon commented Jun 12, 2014

Yes, 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
Copy link
Author

Diapolo commented Jun 12, 2014

I'm currently reworking this...

- returns the BIP70 network string
- use that new function in the core and GUI code and remove unused code
  and functions
@Diapolo Diapolo changed the title [Qt] rework ClientModel::getNetworkName() add NetworkIDString() to chainparams Jun 12, 2014
@Diapolo
Copy link
Author

Diapolo commented Jun 12, 2014

Done...

@laanwj
Copy link
Member

laanwj commented Jun 12, 2014

Seems we have two equivalent pulls now...

@Diapolo
Copy link
Author

Diapolo commented Jun 12, 2014

@laanwj Not really, I took care of clientmodel and rpcconsole also ;).

@laanwj
Copy link
Member

laanwj commented Jun 12, 2014

Right :)
Code changes look OK to me, haven't tested yet.

@jtimon
Copy link
Contributor

jtimon commented Jun 12, 2014

I created another PR (#4333) using jtimon@f5ae6c9 and making my other proposed change (removing chainparams::RPCisTestnet) on top of it.

@BitcoinPullTester
Copy link

Automatic 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 laanwj merged commit f5ae6c9 into bitcoin:master Jun 16, 2014
laanwj added a commit that referenced this pull request Jun 16, 2014
f5ae6c9 add NetworkIDString() to chainparams (Philip Kaufmann)
@Diapolo Diapolo deleted the clientmodel_networkname branch June 17, 2014 05:53
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants