This PR replaces the normal client with a batch client created from rpcclient.NewBatch. All the getrawtransaction requests are now batched with a default size of 10,000, and the batch will wait for 1 second before attempting the next one.
This change is made so less pressure is placed on bitcoind as when the mempool is full, there will be loads of getrawtransaction calls made, resulting in a slow response for other RPC calls such as getblockchaininfo, causing issues in other systems.
The mod files are also updated and a similar check is added here(copied from lnd)
This PR replaces the normal client with a batch client created from
rpcclient.NewBatch
. All thegetrawtransaction
requests are now batched with a default size of 10,000, and the batch will wait for 1 second before attempting the next one.This change is made so less pressure is placed on bitcoind as when the mempool is full, there will be loads of
getrawtransaction
calls made, resulting in a slow response for other RPC calls such asgetblockchaininfo
, causing issues in other systems.The mod files are also updated and a similar check is added here(copied from
lnd
)