chainntnfs: leverage batched JSON-RPC requests to speed up spend/conf rescans
With this PR btcd has now gained support for being able to respond to batched JSON-RPC requests. The client has also been updated to allow several requests to be fired off in a single message as well. bitcoind has supported this feature for some time itself. With this new client-side capability, we can being to take advantage of the now available request pipelining to be able to speed up several interactions within lnd itself.
The goal here is to use the batch JSON-RPC requests to fetch several blocks/transactions/hashes in a single message where relevant across the codebase. Porting over the chainntnfs package to be aware of this new capabilities may serve to significantly speed up long running rescans, spend notification rescans, and also confirmation rescans. We can also extend this into btcwallet itself to speed up the initialization of the wallet, as well as seed import and other on demand rescan attempts.
This PR in btcwallet may resolve this issue: https://github.com/btcsuite/btcwallet/pull/807