Unify RPC connection creation for chain backends #7951
Labels
bitcoind
Bitcoin Core backend
btcd
chain handling
intermediate
Issues suitable for developers moderately familiar with the codebase and LN
P2
should be fixed if one has time
When using
bitcoind
as the chain backend,lnd
creates three RPC connections,chain.NewBitcoindConn
inchainreg
.rpcclient.New
inchainreg
.rpcclient.New
inchainfee
.This could cause issues as
lnd
may make concurrent RPC requests tobitcoind
which may cause failures. This also breaks the abstraction provided bychain.BitcoindConn
as we are now accessing the connection directly. To fix it,rpcclient.New
used in 2 and 3 with thechain.BitcoindConn
created in 1, to make sure we only ever create one RPC connection tobitcoind
.rpcclient.New
withchain.NewRPCClient
forbtcd
backend.chain.NewRPCClient
tochain.NewBtcdClient
inbtcwallet
for clarity.The text was updated successfully, but these errors were encountered: