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

Bugfix on TransactionsView - Disable if privacy mode is set during wallet selection #815

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pablomartin4btc
Copy link
Contributor

Currenlty on master, when the "mask values" checkbox is ticked if the user selects a different wallet, the history action is enable and if the user clicks on it can see all the transactions in the transaction view.

Peek 2024-04-09 17-37

This PR fixes it.

Peek 2024-04-09 17-45

Note for maintainers: this needs to be backported to 25.x and 26.x.

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 9, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
Stale ACK alfonsoromanz

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

No conflicts as of last run.

Copy link
Contributor

@alfonsoromanz alfonsoromanz left a comment

Choose a reason for hiding this comment

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

Tested ACK d3da502

Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

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

This feels like the wrong place to fix it. Why not inside setWalletActionsEnabled (or whatever is enabling it to begin with)?

@pablomartin4btc
Copy link
Contributor Author

This feels like the wrong place to fix it. Why not inside setWalletActionsEnabled (or whatever is enabling it to begin with)?

Yeah, it makes more sense, I'll rework it. Thanks!

@pablomartin4btc pablomartin4btc force-pushed the gui-disable-mask-values-and-tx-view-if-no-wallet-selected branch from d3da502 to 6c3b027 Compare May 22, 2024 10:39
@pablomartin4btc
Copy link
Contributor Author

Updates:

Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

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

I'm pretty sure you can just modify the existing line in setWalletActionsEnabled to:

    historyAction->setEnabled(enabled && !isPrivacyModeActivated());

src/qt/bitcoingui.cpp Outdated Show resolved Hide resolved
src/qt/bitcoingui.cpp Outdated Show resolved Hide resolved
@pablomartin4btc
Copy link
Contributor Author

pablomartin4btc commented May 23, 2024

    historyAction->setEnabled(enabled && !isPrivacyModeActivated());

Just replacing the operator with || (e.g. when the user closes all wallets, all tabs will be disabled except for Transactions).

@pablomartin4btc pablomartin4btc force-pushed the gui-disable-mask-values-and-tx-view-if-no-wallet-selected branch from 6c3b027 to 6180086 Compare May 23, 2024 08:35
@pablomartin4btc
Copy link
Contributor Author

Updates:

@luke-jr
Copy link
Member

luke-jr commented May 23, 2024

This one-line change works without anything else:

#815 (review)

@pablomartin4btc
Copy link
Contributor Author

This one-line change works without anything else:

#815 (review)

Sorry, I made another mistake, thanks for double checking.

To other reviewers: please hold on till next push, thanks.

Making sure that if the privacy mode is activaded during
the wallet selection, the transaction view is not shown.
@pablomartin4btc pablomartin4btc force-pushed the gui-disable-mask-values-and-tx-view-if-no-wallet-selected branch from 6180086 to 260d6eb Compare May 24, 2024 11:03
@pablomartin4btc
Copy link
Contributor Author

Updates:

@hebasto
Copy link
Member

hebasto commented Jul 15, 2024

@pablomartin4btc Did you consider bitcoinknots/bitcoin#83?

@pablomartin4btc
Copy link
Contributor Author

@pablomartin4btc Did you consider bitcoinknots/bitcoin#83?

Yeah, in fact the "switch to Overview" tab when changing/ selecting wallets, was introduced in #718, I can fix it here in a 2nd. commit which will do soon.

@hebasto
Copy link
Member

hebasto commented Jul 15, 2024

@pablomartin4btc

... was introduced in #718...

Sure about PR number? ('cause there is no such a number in this repo)

@pablomartin4btc
Copy link
Contributor Author

@pablomartin4btc

... was introduced in #718...

Sure about PR number? ('cause there is no such a number in this repo)

oh! my bad.. a typo there... how lucky! I'll play the lottery with that one today... I meant #708, I think it's the only place related to the "mask value" where I switched to the overview tab when the mask value checkbox on the menu is ticked but still need to check it.

@pablomartin4btc
Copy link
Contributor Author

@hebasto, I couldn't reproduce the issue described in bitcoinknots/bitcoin#83, trying both master and this PR, also checked the fix in knots which is similar to this PR code change. It would be good to know what was the state of the "mask value" during the use case described in bitcoinknots/bitcoin#83, the only thing I can think of it's that the issue is the same one described above on this PR but when that happens loading a second wallet would disable the Transactions view tab so it can't be selected. Perhaps @luke-jr can describe the steps to reproduce it.

@pablomartin4btc
Copy link
Contributor Author

pablomartin4btc commented Jul 30, 2024

@hebasto, the issue mentioned in bitcoinknots/bitcoin#83 is fixed by this PR.
I've done a bit of investigation and the problem (in master, not on this PR) was not "switching" between wallets (selecting another wallet from the combo box won't show the overview page while the user is landing on the transactions tab), but when the user opens another wallet (which hasn't been loaded before) and the current wallet view is on the transactions/ history tab, then the system sets the overview page as a "default view" lets say (the problematic call has been removed from this PR and it was introduced by #708 originally).

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

Successfully merging this pull request may close these issues.

5 participants