aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/usbwallet/ledger_wallet.go
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/usbwallet/ledger_wallet.go')
-rw-r--r--accounts/usbwallet/ledger_wallet.go10
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)
}