Pink2Dev / Pink2

Pinkcoin 2 Qt wallet and daemon
https://getstarted.with.pink/
MIT License
29 stars 22 forks source link

getstakinginfo output is wrong when wallet is locked #6

Open Scalextrix opened 6 years ago

Scalextrix commented 6 years ago

On the v2.1.0.4 SpockySpock version, when using the headless version on Linux, calling the RPC getstakinginfo returns

{ "enabled" : true, "staking" : false, "errors" : "", ... }

Even if the wallet is fully locked, "enabled" : true still shows, this leads to confusion if a user is in CLI only and is trying to understand why "staking" : false.

PinkDev commented 6 years ago

Result is not wrong, though I am considering including 'wallet is locked' in errors. This behavior is consistent and standard for staking coins.

"staking" is congruent with the green arrow in the UI client. While it might be worth including the reason in "errors" to match the tooltip in the UI when it is not staking, the functionality of 'enabled' is necessary for server operators to know for certain that staking has or has not been disabled on their server - regardless of whether or not the wallet is currently locked.

Scalextrix commented 6 years ago

Other coins I run in CLI staking arent all consistent, some do use "enabled" : false to signify the wallet locked, others use the "errors" : "" to deliver a message. One or the other would be fine, thanks.

PinkDev commented 6 years ago

Fair enough.

Fwiw, I just know the decision was standard a few years ago when I was working on coins. The reason is that for many server types (exchanges, pools, etc.) it is important to know that staking is disabled before unlocking the wallet.