Skip to content

Tiny balance update bug after importprivkey #640

Open
@hebasto

Description

@hebasto

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingWallet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions