Describe the issue
Can you reliably reproduce the issue?
Yes.
If so, please list the steps to reproduce below:
- Using default options, with bitcoin-cli, call importprivkey (or I assume importaddress or importpubkey too).
Expected behaviour
Call should succeed.
Actual behaviour
bitcon-cli will timeout after 15 minutes, per default -rpcclienttimeout, exit with code 1. Bitcoind will complete the command in the background.
What version of bitcoin-core are you using?
58861ad9
Machine specs:
- OS: Debian stretch
- CPU: i7-2600K CPU @ 3.40GHz
- RAM: 16018 Mb
- Disk Type (HD/SDD): HD
Adjusting -rpcclienttimeout, the call takes 27 minutes on my machine.
I can see 3 options for solving this:
Increase the default -rpcclienttimeout. It appeared to be cpu bound. There are probably a not insignificant amount of people with slower cpus which take 1 hour or more. I can test on a raspberry pi. I assume the time is roughly linearly proportional to the blockchain size, which will double in 2 years time or so. So a default timeout which is expected to work for most people for a few years could be 3 hours or more. The timeout was last changed via commit 2190ea6c4e7f5 in September 2015, changing it from 30 seconds to 15 minutes.
Increase the default -rpcclienttimeout only when a rescan is requested. I'm not sure if this is the only call which needs a higher timeout.
Add a warning in the help output for calls which trigger a rescan about the default -rpcclienttimeout being too low.