gui icon indicating copy to clipboard operation
gui copied to clipboard

Tiny balance update bug after importprivkey

Open hebasto opened this issue 3 years ago • 0 comments

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):

  1. generate 101
  2. getnewaddress, store somewhere
  3. sendtoaddress <addr-from-2> 10
  4. dumpprivkey <addr-from-2>, store somewhere
  5. Stop node
  6. Remove wallet.dat
  7. Start node
  8. importaddress <addr-from-2> (== triggers rescan) watch only balance should list properly
  9. importprivkey "<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.

hebasto avatar Aug 05 '22 09:08 hebasto