[backport#15751] Speed up deriveaddresses for large ranges
Summary:
https://github.com/bitcoin/bitcoin/pull/15751/commits/41a46cbb31f1622f7d1ff54c7a1c1ca701c1e754
Depends on D6626
Backport of Core PR15751
Test Plan:
ninja check test_runner.py wallet_importmulti rpc_scantxoutset
Reviewers: #bitcoin_abc, nakihito
Reviewed By: nakihito
Differential Revision: https://reviews.bitcoinabc.org/D6641