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

Opening an 'Ended' witness account freezes the application #205

Closed
orobio opened this issue Apr 6, 2020 · 4 comments
Closed

Opening an 'Ended' witness account freezes the application #205

orobio opened this issue Apr 6, 2020 · 4 comments

Comments

@orobio
Copy link
Contributor

orobio commented Apr 6, 2020

When an 'Ended' (no longer locked but with a positive balance), witness account is opened, the application freezes. This also happens when said witness account is active during start-up of the application. In that case, the wallet user interface is never shown and the application only shows 'Done'.

Version: v2.2.0.5

Debug info
The following code results in an infinite loop:
https://github.com/Gulden/gulden-official/blob/209bdbd9884087dd62ebbc720f207ccc6cca96ae/src/qt/_Gulden/witnessdialog.cpp#L582-L593

This is due to that infoForAccount.nOriginWeight equals 0, resulting in nEstimatedWitnessBlockPeriodOrigin to be 0, which makes the loop increment 0.

infoForAccount.nOriginWeight is set here:
https://github.com/Gulden/gulden-official/blob/209bdbd9884087dd62ebbc720f207ccc6cca96ae/src/qt/_Gulden/witnessdialog.cpp#L521-L522
Instead of the original weight it reflects the current weight of the account, which is 0 because the lock period has passed.

I guess this could use a similar fix as is done for infoForAccount.nOriginNetworkWeight (see first snippet), where the weight is set to a default value if it equals 0, but I'm not very familiar with the code so there might be a better solution.

@mjmacleod
Copy link
Member

Thanks for the detailed report, will look into it and implement a fix

@mjmacleod
Copy link
Member

I've pushed a proposed fix to 2.2_development branch 50cf025

If you are able to test this and check if it will work for you that would be useful. If not then the next builds will likely contain it so you can give it a try then.

If you urgently need to empty the account in the interim, its possible to work around this by using the move command via RPC or debug window.

@orobio
Copy link
Contributor Author

orobio commented Apr 6, 2020

Fix looks good to me. I can probably find some time to test it in the next few days and will report back.

@orobio
Copy link
Contributor Author

orobio commented Apr 10, 2020

I see the issue is already closed, but just FYI, I tested with v2.2.0.6 and it looks good. Thanks for taking this up so quickly.

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

No branches or pull requests

2 participants