Disabling wallet should disable staking as well #752
Labels
Component: Core App
Related to the application itself.
Component: Wallet
Relating to keystore, tx creation, and balance tracking
Tag: PoS
Related to Proof of Stake
Tag: PoW
Related to Proof of Work consensus
Problem
The problem is that in the BlockAssembler::CreateNewBlock, there is a bunch of messy code that just returns null to prevent you from staking if you have a wallet disabled. The issue is that this is just all redundant and this code and thread will keep running returning a
nullptr
.miner.cpp @ BlockAssembler::CreateNewBlock
Expected
What I had expected is that disabling the wallet should prevent staking without needing to set an option. I'm unsure of the performance hit, if any, of this pointless code execution on the staking thread when it should never get this far.
Behaviour
The actual behaviour is that instead the code gets as far as spinning up a new Staking thread that does nothing but return a
nullptr
Proposed Fix
A simple fix would be just to prevent staking when you disable the wallet even IF staking is enabled in the config.
The text was updated successfully, but these errors were encountered: