-
Notifications
You must be signed in to change notification settings - Fork 273
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
qt: Remove network detection based on address in BIP21 #563
qt: Remove network detection based on address in BIP21 #563
Conversation
Discussion on IRC that triggered this change:
|
72d0e2e
to
2d41f4d
Compare
cc @dongcarl |
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.
Code review ACK 2d41f4d
There is also a possibility for refactor after this as the initialization order of
PaymentServer::ipcParseCommandLine
isn't important anymore
Was curious about this and 2102ab9 looks like the related commit.
The comment just above in this function looks like it should be moved as well.
// Warning: ipcSendCommandLine() is called early in init,
// so don't use "Q_EMIT message()", but "QMessageBox::"!
I'm not sure. Does the comment refer to the wrong function, or should it be moved? I think it's valid for both I could update the comment but also remove it. |
Oh sorry, I was thinking more when refactoring as you mentioned; it's not related to this change. |
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.
crACK 2d41f4d
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.
ACK 2d41f4d
I hadn't noticed before that |
This is some very ugly and brittle code that switches the global network based on a provided address, remove it. I think in practice it's very unlikely for testnet BIP21 payment URIs to be used, and if so it's for testing so it's easy enough to manually copy it. Or to specify `-testnet` explicitly. There is already no case for `-regtest` or `-signet`.
2d41f4d
to
b7dbc83
Compare
Good point. Verified at https://doc.qt.io/qt-5/qset.html#insert that a ACK b7dbc83 |
ACK b7dbc83 |
This is removes some ugly and brittle code that switches the global network to testnet based on a provided address. I think in practice it's very unlikely for testnet BIP21 payment URIs to be used, and if so it's for testing so it's easy enough to manually copy it. Or to specify
-testnet
explicitly.There is already no such case for
-regtest
or-signet
.After this change it will only accept addresses for the explicitly selected network. Others will result in a "wrong network" popup.
There is also a possibility for refactor after this as the initialization order of
PaymentServer::ipcParseCommandLine
isn't important anymore (well, it still has to be beforePaymentServer::ipcSendCommandLine
, maybe even merged with it), but I have not done so here.