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

init: torcontrol argument should be validated #23589

Open
laanwj opened this issue Nov 25, 2021 · 6 comments · May be fixed by #23605
Open

init: torcontrol argument should be validated #23589

laanwj opened this issue Nov 25, 2021 · 6 comments · May be fixed by #23605

Comments

@laanwj
Copy link
Member

@laanwj laanwj commented Nov 25, 2021

I accidentally -torcontrol=1 today (instead of -listenonion=1) and was confused that it was accepted, as the argument needs to be host:port.

Expected outcome would be an error message and exiting.

Useful skills:

  • C++
  • Understanding of bitcoin core's initialization sequence

Want to work on this issue?

For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.

@shaavan
Copy link
Contributor

@shaavan shaavan commented Nov 25, 2021

Let me try tackling this!

@shaavan
Copy link
Contributor

@shaavan shaavan commented Nov 25, 2021

Ok, so I was able to add a function successfully that can check if the given string is a valid <host>:<port> pair or not. The issue is that I cannot raise an error when the argument is wrongly passed when initializing bitcoind.

In fact, bitcoind is not raising an error for any invalid argument passed at initialization.

Screenshot from 2021-11-25 18-43-22

Expected outcome would be an error message and exiting.

Just a confirmation. When the ./src/bitcoind command is initially run with invalid parameters, do we expect an error message and exit? Or is it expected to occur later in the runtime of bitcoind?

@amovfx
Copy link

@amovfx amovfx commented Nov 25, 2021

Is the Args Manager flags supposed to help with this?

@ityodadev
Copy link

@ityodadev ityodadev commented Nov 26, 2021

common sense would suggest there should be a message and some exit status, other than 0

@shaavan
Copy link
Contributor

@shaavan shaavan commented Nov 26, 2021

A gentle ping, @laanwj. Would you please take a look at this comment?

@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Nov 26, 2021

git grep InitError might help you.

@shaavan shaavan linked a pull request that will close this issue Nov 26, 2021
@bitcoin bitcoin deleted a comment from Wonders11 Nov 27, 2021
@bitcoin bitcoin deleted a comment from ComplaintID Nov 28, 2021
@uri44derr13 uri44derr13 mentioned this issue Dec 19, 2021
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants