rpc: Use context.TODO instead of .Background

This commit is contained in:
jholdstock 2022-05-19 07:56:58 +01:00 committed by Jamie Holdstock
parent 1db99bfddf
commit 4beb036663
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ func (d *DcrdConnect) Close() {
// Client creates a new DcrdRPC client instance. Returns an error if dialing // Client creates a new DcrdRPC client instance. Returns an error if dialing
// dcrd fails or if dcrd is misconfigured. // dcrd fails or if dcrd is misconfigured.
func (d *DcrdConnect) Client() (*DcrdRPC, string, error) { func (d *DcrdConnect) Client() (*DcrdRPC, string, error) {
ctx := context.Background() ctx := context.TODO()
c, newConnection, err := d.client.dial(ctx) c, newConnection, err := d.client.dial(ctx)
if err != nil { if err != nil {
return nil, d.client.addr, fmt.Errorf("dcrd connection error: %w", err) return nil, d.client.addr, fmt.Errorf("dcrd connection error: %w", err)

View File

@ -53,7 +53,7 @@ func (w *WalletConnect) Close() {
// increments a count of failed connections if a connection cannot be // increments a count of failed connections if a connection cannot be
// established, or if the wallet is misconfigured. // established, or if the wallet is misconfigured.
func (w *WalletConnect) Clients() ([]*WalletRPC, []string) { func (w *WalletConnect) Clients() ([]*WalletRPC, []string) {
ctx := context.Background() ctx := context.TODO()
walletClients := make([]*WalletRPC, 0) walletClients := make([]*WalletRPC, 0)
failedConnections := make([]string, 0) failedConnections := make([]string, 0)