nochowderforyou / clams

Clam Project
MIT License
61 stars 58 forks source link

GUI sometimes shows "Not staking because you don't have mature coins" wrongly #188

Closed dooglus closed 9 years ago

dooglus commented 9 years ago

I've heard reports from a couple of people that their staking icon goes red after an output stakes, even though they have multiple other mature outputs.

It seems the trouble is that in qt/bitcoingui.cpp, updateWeight() only updates nWeight if the wallet lock isn't currently held. Sometimes it is held, and so nWeight is left as it was before.

After calling updateWeight, updateStakingIcon() does this:

    nWeight /= COIN;

if the wallet lock is held, that division will be done twice, turning any number of CLAMs into 0, and making the "no mature coins" message show up.

The solution is to use a local variable for the result of the division.

I'll make a pull request for it.