Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Better document Ledger's exchangeTimeout, and slighly increase the value
Browse files Browse the repository at this point in the history
  • Loading branch information
liamzebedee committed Apr 15, 2020
1 parent 2c101b2 commit 52e8012
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/connectors/ledger.js
Expand Up @@ -46,10 +46,11 @@ export class LedgerConnector extends AbstractConnector {
let ledgerEthereumClientFactoryAsync = async () => {
const ledgerConnection = await TransportU2F.create()
// Ledger will automatically timeout the U2F "sign" request after `exchangeTimeout` ms.
// This will result in a cryptic error:
// The default is set at an annoyingly low threshold, of 10,000ms,
// which results in this cryptic error:
// `{name: "TransportError", message: "Failed to sign with Ledger device: U2F DEVICE_INELIGIBLE", ...}`
// Setting the exchange timeout fixes that, although I haven't seen it documented anywhere else in the Ledger docs.
ledgerConnection.setExchangeTimeout(100000)
// Here we set it much higher, to avoid this occurring.
ledgerConnection.setExchangeTimeout(1000000000)
const ledgerEthClient = new AppEth(ledgerConnection)
return ledgerEthClient
}
Expand Down

0 comments on commit 52e8012

Please sign in to comment.