Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Kulahin on November 19, 2019, 08:27:16 PM



Title: -importaddress takes >20min
Post by: Kulahin on November 19, 2019, 08:27:16 PM
hello, why -importaddress is so slow ? i have SSD NVMe Pcie4x4 Aourus 2TB ~5gbit read speed and intel i9 processor, speed maximum is 100mb read


Title: Re: -importaddress takes >20min
Post by: HCP on November 19, 2019, 09:46:37 PM
Quote
importaddress "address" ( "label" rescan p2sh )

Note: This call can take over an hour to complete if rescan is true

Arguments:
1. address    (string, required) The Bitcoin address (or hex-encoded script)
2. label      (string, optional, default="") An optional label
3. rescan     (boolean, optional, default=true) Rescan the wallet for transactions
4. p2sh       (boolean, optional, default=false) Add the P2SH version of the script as well
Sounds like 20 minutes is better than 1 hour! ;) If you don't explicitly specify the rescan parameter as "false"... then every time you use the importaddress commmand, it will rescan the entire blockchain looking for transactions that relate to that address.

So, if you're importing multiple addresses, you should specify "rescan" as "false" until you get to the last address that you want to import... then specify that as "true" and it will rescan ALL of them at the same time.


Title: Re: -importaddress takes >20min
Post by: R.I.U. iol on November 19, 2019, 10:05:06 PM
Because it scans the entire blockchain to see what transactions have an outout to to that address, so you can see it's balance and UTXO.