importprivkey fails when walletnotify is set #6084

issue y opened this issue on April 29, 2015
  1. y commented at 2:54 PM on April 29, 2015: none

    If I have walletnotify set in my conf and try to import a private key, it always fails with:

    $ bitcoin-cli importprivkey $key
    error: {"code":-1,"message":"boost::thread_resource_error: Resource temporarily unavailable"}
    

    I was watching the debug log when this happens, and see the rescan is calling AddToWallet for ALL past transactions, not just for the new imported private key. And it's trying to run the walletnotify program for every transaction.

    The only way I can get this to work is to first stop bitcoin, disable walletnotify, then restart bitcoin to perform the importprivkey, then stop and re-enable walletnotify and restart.

  2. wtogami commented at 10:07 AM on May 13, 2015: contributor

    What are you running exactly with walletnotify?

  3. wtogami commented at 10:41 AM on May 13, 2015: contributor

    See also #6095 which is the same complaint for importaddress. Unclear if this is a bug though ...

  4. y commented at 5:27 PM on May 14, 2015: none

    What are you running exactly with walletnotify?

    A bash script that calls gettransaction and getbalance.

    See also #6095 which is the same complaint for importaddress. Unclear if this is a bug though ...

    Yes, same problem. And I agree with the reporter of that ticket- it's a bug if it's resulting in wallnetnotify script to be called for every transaction in the wallet, and not just the transactions belonging to the new key/address.

    Even if this bug and #6095 are resolved to only trigger notifications corresponding only to the specified key/address, running bitcoind -rescan will result in too many simultaneous processes. A thread pool would solve that, right?

  5. wtogami commented at 5:23 AM on May 15, 2015: contributor

    The guy in #6095 didn't listen when I told him his system could still fail under normal operation even if the rescan behavior were made specific during an import. He furthermore could have skipped the rescan entirely if he used rescan=false as he indicated the key was new.

  6. laanwj added the label Bug on May 15, 2015
  7. laanwj added the label Wallet on May 15, 2015
  8. cheako commented at 8:19 AM on May 18, 2015: none

    #6031 also a duplicate.

  9. meshcollider commented at 3:46 AM on March 8, 2018: contributor

    I assume this is no longer an issue in the same way as https://github.com/bitcoin/bitcoin/issues/6095

  10. meshcollider closed this on Mar 8, 2018

  11. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me