Commit 2fa9e99f authored by Corey Lin's avatar Corey Lin Committed by Péter Szilágyi

usbwallet: check error returned by driver close (#18057)

Although current two implementations(ledgerDriver, trezorDriver) of interface driver.Close do not actually return any error. Instead, they only return nil.
But since the declaration of Close function returns error, it is better to check the returned error in case in future some new implementation of Close function returns error and we may forget to modify the function which invokes Close function at that time.
parent 5f94f8c7
...@@ -274,9 +274,7 @@ func (w *wallet) close() error { ...@@ -274,9 +274,7 @@ func (w *wallet) close() error {
w.device = nil w.device = nil
w.accounts, w.paths = nil, nil w.accounts, w.paths = nil, nil
w.driver.Close() return w.driver.Close()
return nil
} }
// Accounts implements accounts.Wallet, returning the list of accounts pinned to // Accounts implements accounts.Wallet, returning the list of accounts pinned to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment