bitcoin / bitcoin

Bitcoin Core integration/staging tree
https://bitcoincore.org/en/download
MIT License
78.49k stars 36.19k forks source link

importprivkey RPC call locks the whole client while rescanning #1011

Closed davout closed 6 years ago

davout commented 12 years ago

When I import a private key, other JSON-RPC calls seem frozen and return a result only when the private key import JSON-RPC call has finished.

This makes the feature hardly usable when used in web app or other shared wallet contexts.

EDIT : Tested on latest master

TheBlueMatt commented 12 years ago

Currently all RPC calls take both cs_main and pwalletMain->cs_wallet locks, this is true of any rpc call. See https://github.com/bitcoin/bitcoin/blob/master/src/bitcoinrpc.cpp#L2529

weex commented 12 years ago

A possible way to speed this up, especially for recently generated addresses, would be to allow a parameter to this RPC call that specifies the earliest block to consider in a rescan.

promag commented 9 years ago

@weex #6570

unsystemizer commented 7 years ago

Just encountered this on 0.12.1. Following this link it turns out #7551 (merged into master 23 days ago) fixes this by adding the feature mentioned by weex.

@davout can you try with 0.13.1 (I think the fix went in before its release)? I can't upgrade my instance yet.