If you import a private key of an address you are already watching and without a rescan, the available balance does not upgrade correctly.
Steps (regtest):
generate 101
getnewaddress
, store somewheresendtoaddress <addr-from-2> 10
dumpprivkey <addr-from-2>
, store somewhere- Stop node
- Remove wallet.dat
- Start node
importaddress <addr-from-2>
(== triggers rescan) watch only balance should list properlyimportprivkey "<WIF-key-from-4>" "test" false
will lead to available balance of 0 (but should be 10)
A restart solves the issue.
Bitcoind (listtransactions, getbalance, etc.) is not affected.
Moved from bitcoin/bitcoin#11477.