diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-03-23 23:04:39 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-03-23 23:04:39 +0800 |
commit | 8ff7e55ab547e6c915a74971126f64b7582f2b77 (patch) | |
tree | 7db22dd944c1f1197cbbda1c4e16b54818d3c4db /accounts/usbwallet/ledger_wallet.go | |
parent | 26da6daaa96a6d45187e5a2ff519676e9e772cb2 (diff) | |
download | go-tangerine-8ff7e55ab547e6c915a74971126f64b7582f2b77.tar go-tangerine-8ff7e55ab547e6c915a74971126f64b7582f2b77.tar.gz go-tangerine-8ff7e55ab547e6c915a74971126f64b7582f2b77.tar.bz2 go-tangerine-8ff7e55ab547e6c915a74971126f64b7582f2b77.tar.lz go-tangerine-8ff7e55ab547e6c915a74971126f64b7582f2b77.tar.xz go-tangerine-8ff7e55ab547e6c915a74971126f64b7582f2b77.tar.zst go-tangerine-8ff7e55ab547e6c915a74971126f64b7582f2b77.zip |
accounts/usbwallet: if a confirmation is pending, skip refresh
Diffstat (limited to 'accounts/usbwallet/ledger_wallet.go')
-rw-r--r-- | accounts/usbwallet/ledger_wallet.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/accounts/usbwallet/ledger_wallet.go b/accounts/usbwallet/ledger_wallet.go index 97434ed3b..f1beebb2c 100644 --- a/accounts/usbwallet/ledger_wallet.go +++ b/accounts/usbwallet/ledger_wallet.go @@ -579,9 +579,15 @@ func (w *ledgerWallet) SignTx(account accounts.Account, tx *types.Transaction, c // Ensure the device isn't screwed with while user confirmation is pending // TODO(karalabe): remove if hotplug lands on Windows - w.hub.commsLock.RLock() - defer w.hub.commsLock.RUnlock() + w.hub.commsLock.Lock() + w.hub.commsPend++ + w.hub.commsLock.Unlock() + defer func() { + w.hub.commsLock.Lock() + w.hub.commsPend-- + w.hub.commsLock.Unlock() + }() return w.ledgerSign(path, account.Address, tx, chainID) } |