I noticed a strange behavior with my wallet. I sent a few coins and that generated a change (let's call this change amount X). This transaction is still unconfirmed. Immediately after starting the wallet, the balance shows Y (which includes this unconfirmed change amount X), and after a few minutes the balance shows Z (which equals Y-X, i.e. it does not include the unconfirmed change amount X). If I restart the wallet I get the same behavior (balance is Y then it goes down to Z).
I find it really weird that the balance suddenly goes down! Is this a bug? If not then can you explain why this could be happening?
I'm using Bitcoin Core 0.14.1 and to get the balance I'm using the command "bitcoin-cli getbalance".
Thanks in advance.