Skip to content

Commit 523ecc0

Browse files
committed
multi: wait for rpcclients shutdown to complete
We need to call `WaitForShutdown` after stopping the rpc clients of the chain backends.
1 parent 304c8df commit 523ecc0

File tree

7 files changed

+8
-4
lines changed

7 files changed

+8
-4
lines changed

chainntnfs/bitcoindnotify/bitcoind.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ func (b *BitcoindNotifier) Stop() error {
139139
// Shutdown the rpc client, this gracefully disconnects from bitcoind,
140140
// and cleans up all related resources.
141141
b.chainConn.Stop()
142+
b.chainConn.WaitForShutdown()
142143

143144
close(b.quit)
144145
b.wg.Wait()

chainntnfs/btcdnotify/btcd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func (b *BtcdNotifier) Stop() error {
180180

181181
// Shutdown the rpc client, this gracefully disconnects from btcd, and
182182
// cleans up all related resources.
183-
b.chainConn.Shutdown()
183+
b.chainConn.Stop()
184184

185185
close(b.quit)
186186
b.wg.Wait()

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
1212
github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c
1313
github.com/btcsuite/btclog/v2 v2.0.0-20241017175713-3428138b75c7
14-
github.com/btcsuite/btcwallet v0.16.10-0.20240912233857-ffb143c77cc5
14+
github.com/btcsuite/btcwallet v0.16.10-0.20241113134707-b4ff60753aaa
1515
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5
1616
github.com/btcsuite/btcwallet/wallet/txrules v1.2.2
1717
github.com/btcsuite/btcwallet/walletdb v1.4.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c/go.mod h1:w7xnGOhw
9595
github.com/btcsuite/btclog/v2 v2.0.0-20241017175713-3428138b75c7 h1:3Ct3zN3VCEKVm5nceWBBEKczc+jvTfVyOEG71ob2Yuc=
9696
github.com/btcsuite/btclog/v2 v2.0.0-20241017175713-3428138b75c7/go.mod h1:XItGUfVOxotJL8kkuk2Hj3EVow5KCugXl3wWfQ6K0AE=
9797
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
98-
github.com/btcsuite/btcwallet v0.16.10-0.20240912233857-ffb143c77cc5 h1:zYy233eUBvkF3lq2MUkybEhxhDsrRDSgiToIKN57mtk=
99-
github.com/btcsuite/btcwallet v0.16.10-0.20240912233857-ffb143c77cc5/go.mod h1:1HJXYbjJzgumlnxOC2+ViR1U+gnHWoOn7WeK5OfY1eU=
98+
github.com/btcsuite/btcwallet v0.16.10-0.20241113134707-b4ff60753aaa h1:x7vYpwkPL5zeJEWPPaRunybH9ERRMGWeNf7x/0aU/38=
99+
github.com/btcsuite/btcwallet v0.16.10-0.20241113134707-b4ff60753aaa/go.mod h1:1HJXYbjJzgumlnxOC2+ViR1U+gnHWoOn7WeK5OfY1eU=
100100
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5 h1:Rr0njWI3r341nhSPesKQ2JF+ugDSzdPoeckS75SeDZk=
101101
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5/go.mod h1:+tXJ3Ym0nlQc/iHSwW1qzjmPs3ev+UVWMbGgfV1OZqU=
102102
github.com/btcsuite/btcwallet/wallet/txrules v1.2.2 h1:YEO+Lx1ZJJAtdRrjuhXjWrYsmAk26wLTlNzxt2q0lhk=

lnwallet/chainfee/estimator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ func (b *BtcdEstimator) Stop() error {
238238
b.filterManager.Stop()
239239

240240
b.btcdConn.Shutdown()
241+
b.btcdConn.WaitForShutdown()
241242

242243
return nil
243244
}

routing/chainview/bitcoind.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ func (b *BitcoindFilteredChainView) Stop() error {
136136
// Shutdown the rpc client, this gracefully disconnects from bitcoind's
137137
// zmq socket, and cleans up all related resources.
138138
b.chainClient.Stop()
139+
b.chainClient.WaitForShutdown()
139140

140141
b.blockQueue.Stop()
141142

routing/chainview/btcd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ func (b *BtcdFilteredChainView) Stop() error {
146146
// Shutdown the rpc client, this gracefully disconnects from btcd, and
147147
// cleans up all related resources.
148148
b.btcdConn.Shutdown()
149+
b.btcdConn.WaitForShutdown()
149150

150151
b.blockQueue.Stop()
151152

0 commit comments

Comments
 (0)