Skip to content
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

updated utils to handle regtest, simnet #153

Closed
wants to merge 1 commit into from

Conversation

@tuxcanfly
Copy link
Contributor

@tuxcanfly tuxcanfly commented Jul 21, 2014

I found showblock useful but saw that it doesn't support simnet, so I've added support for regtest and simnet. Also updated other utils while I was at it.

@jrick
Copy link
Member

@jrick jrick commented Jul 21, 2014

These patches should also include a 'numNets' variable or similar so that multiple alternate networks specified either on the command line or in a config file can be caught. Take a look at how btcd implements this in config.go.

The network parameters also includes the network name, so showblock could get the name directly from there instead of hardcoding the directory name. The only gotcha here is that btcd saves testnet3 data into a "testnet" directory instead, so take a look at the netName function in btcd params.go for a sane way to get around this.

Loading

@tuxcanfly
Copy link
Contributor Author

@tuxcanfly tuxcanfly commented Jul 21, 2014

OK, updated to use netName and handle error case on passing multiple nets. Tested that the error cases shows the expected error message.

Loading


// Choose the active network params based on the selected network.
if cfg.TestNet3 {
activeNetParams = &btcnet.TestNet3Params
Copy link
Member

@davecgh davecgh Jul 21, 2014

Choose a reason for hiding this comment

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

Please just set these in the statements above. Only one will be set due to the if numNets > 1 check.

Loading

@tuxcanfly
Copy link
Contributor Author

@tuxcanfly tuxcanfly commented Jul 21, 2014

Thanks @davecgh Updated to handle active network in the same if-else instead of another switch-case. Added comments explaining the change.

Loading

@davecgh
Copy link
Member

@davecgh davecgh commented Jul 21, 2014

This looks good now. Thanks @tuxcanfly.

OK

Loading

@jrick
Copy link
Member

@jrick jrick commented Jul 21, 2014

OK

Loading

handle active network assignment in the same if-else
instead of having another switch-case
@davecgh
Copy link
Member

@davecgh davecgh commented Jul 22, 2014

This has been rebased and merged as commit 458a996.

Loading

@davecgh davecgh closed this Jul 22, 2014
@tuxcanfly tuxcanfly deleted the util-networks branch Jul 22, 2014
@tuxcanfly
Copy link
Contributor Author

@tuxcanfly tuxcanfly commented Jul 22, 2014

Thanks!

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants