Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update qt.cpp to match block_count RPC & fix bug with pruned display #4000

Merged
merged 5 commits into from
Nov 17, 2022
Merged

Conversation

qwahzi
Copy link
Collaborator

@qwahzi qwahzi commented Nov 16, 2022

Currently the QT wallet 1) does not show cemented count, 2) has "Full" directly appended to the unchecked count (no comma or space), and 3) the "Pruned" count is always empty (due to a minor concatenation bug). This change fixes that.

Here is a screenshot of the current situation, where "Cemented" is missing and the "Pruned" count does not display correctly:

image

Currently the QT wallet 1) does not show cemented count, 2) has "Full" directly appended to the unchecked count (no comma or space), and the "Pruned" count is always empty (due to a minor concatenation bug). This change fixes that
pwojcikdev
pwojcikdev previously approved these changes Nov 16, 2022
Copy link
Contributor

@pwojcikdev pwojcikdev left a comment

Choose a reason for hiding this comment

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

Looks good. I'm thinking if maybe in addition we should always include cemented and unchecked count, it's an important indicator. Right now those sometimes skipped

@qwahzi
Copy link
Collaborator Author

qwahzi commented Nov 16, 2022

I'm thinking if maybe in addition we should always include cemented and unchecked count, it's an important indicator. Right now those sometimes skipped

Thanks for reviewing! If I understand correctly, you're asking me to remove the if statements for queued & cemented - do I need to do anything else for exception handling/error checking (e.g. if the values happened to be null for some reason)?

I.e. going from this:

	if (unchecked != 0 && wallet.node.bootstrap_initiator.in_progress ())
	{
		count_string += ", Queued: " + std::to_string (unchecked);
	}

	if (cemented != 0)
	{
		count_string += ", Cemented: " + std::to_string (cemented);
	}

To this:

	count_string += ", Queued: " + std::to_string (unchecked);
	count_string += ", Cemented: " + std::to_string (cemented);

EDIT:

I see that the cemented and unchecked variables are initialized and set to 0 by default, so I went ahead and removed the if-statements for now. Let me know if that works, or if I need to make additional changes

Removing if-statements for cemented and unchecked, per #4000 (review)
@qwahzi
Copy link
Collaborator Author

qwahzi commented Nov 16, 2022

Semi-related, would it make sense to rename "Queued" to "Unchecked" to match the RPC and colloquial usage? I don't see many node operators or developers referring to "Queued" these days, only "Unchecked"

@pwojcikdev
Copy link
Contributor

Yes, removing the if statements is exactly what I was thinking about. Also using "Unchecked" makes more sense to me, I have never seen anyone using "Queued".

Renaming "Queued" to "Unchecked" per colloquial usage and comment here: #4000 (comment)
@qwahzi
Copy link
Collaborator Author

qwahzi commented Nov 16, 2022

Perfect, thanks! The requested changes have been made

@dsiganos
Copy link
Contributor

Nice removal of complexity, checking for bootstrap in progress doesn't make much sense, we are always in bootstrapping mode, bootstrapping never stops and it is misleading to pretend otherwise.

pwojcikdev
pwojcikdev previously approved these changes Nov 16, 2022
dsiganos
dsiganos previously approved these changes Nov 16, 2022
@dsiganos
Copy link
Contributor

Look like unit test 'wallet.enter_password' broke by this change because it is looking for a specific status line.

Search that the status line starts with the right words and ignore the
counts, which are not directly relevant to this test.
@dsiganos dsiganos dismissed stale reviews from pwojcikdev and themself via 4a1c799 November 16, 2022 17:44
@dsiganos dsiganos merged commit da37e91 into nanocurrency:develop Nov 17, 2022
@qwahzi qwahzi deleted the patch-1 branch November 17, 2022 12:34
@qwahzi qwahzi added the qt wallet Item related to the qt wallet label Dec 29, 2022
@qwahzi qwahzi added this to the V24.0 milestone Dec 29, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
qt wallet Item related to the qt wallet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants