aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/usbwallet
diff options
context:
space:
mode:
authorCorey Lin <514971757@qq.com>2019-03-07 18:13:06 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-03-07 18:13:06 +0800
commit2fa9e99fc19d2804d2409ab5904f4c154e70e6cd (patch)
tree7ccfdd190dac0e00ad5e157660b759de5dcaa7b3 /accounts/usbwallet
parent5f94f8c7e7cfc6d037accfad379ce2ab0df6bf47 (diff)
downloadgo-tangerine-2fa9e99fc19d2804d2409ab5904f4c154e70e6cd.tar
go-tangerine-2fa9e99fc19d2804d2409ab5904f4c154e70e6cd.tar.gz
go-tangerine-2fa9e99fc19d2804d2409ab5904f4c154e70e6cd.tar.bz2
go-tangerine-2fa9e99fc19d2804d2409ab5904f4c154e70e6cd.tar.lz
go-tangerine-2fa9e99fc19d2804d2409ab5904f4c154e70e6cd.tar.xz
go-tangerine-2fa9e99fc19d2804d2409ab5904f4c154e70e6cd.tar.zst
go-tangerine-2fa9e99fc19d2804d2409ab5904f4c154e70e6cd.zip
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.
Diffstat (limited to 'accounts/usbwallet')
-rw-r--r--accounts/usbwallet/wallet.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go
index feab505c9..2ddfa30a6 100644
--- a/accounts/usbwallet/wallet.go
+++ b/accounts/usbwallet/wallet.go
@@ -274,9 +274,7 @@ func (w *wallet) close() error {
w.device = nil
w.accounts, w.paths = nil, nil
- w.driver.Close()
-
- return nil
+ return w.driver.Close()
}
// Accounts implements accounts.Wallet, returning the list of accounts pinned to