Symptom

When trying to send coins or optimize for staking the following error appears:


Error: The wallet was unlocked only to anonymize coins.



Cause

The wallet was unlocked, but only for staking.  This is a security measure that allows you to stake safely without opening up your coins to easy theft.


Solution

To continue, you will need to lock your wallet (which stops staking) and then fully unlock it.  

For the GUI or qt wallet, you can follow these steps:

1. Select Settings > Lock Wallet
2. Select Settings > Unlock Wallet
3. Provide your passphrase as requested and do not check 'For anonymization and staking only'
4. You should be able to proceed without the error

For the command line wallet, you can follow these steps (more info here):

1. Enter pivx-cli walletlock
2. Enter pivx-cli walletpassphrase <your passphrase> <timeout in seconds, 0 for indefinite> <true/false unlock for staking/anon only>

In other words: pivx-cli CorrectHorseBatteryStaple 0 false

Now you should be able to proceed without the error