Skip to content

Commit 9ff0780

Browse files
authored
Merge pull request #2450 from FiveBellsSettlement/btc-client-correct-dialcontext
rpcclient: ensure http dial respects timeout
2 parents e764c17 + 582b999 commit 9ff0780

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rpcclient/infrastructure.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,10 +1356,11 @@ func newHTTPClient(config *ConnConfig) (*http.Client, error) {
13561356
Transport: &http.Transport{
13571357
Proxy: proxyFunc,
13581358
TLSClientConfig: tlsConfig,
1359-
DialContext: func(_ context.Context, _,
1359+
DialContext: func(ctx context.Context, _,
13601360
_ string) (net.Conn, error) {
1361-
1362-
return net.Dial(
1361+
d := &net.Dialer{}
1362+
return d.DialContext(
1363+
ctx,
13631364
parsedDialAddr.Network(),
13641365
parsedDialAddr.String(),
13651366
)

0 commit comments

Comments
 (0)