From 94ecd1db22019010d39940e4f0a8b6b463a9ca61 Mon Sep 17 00:00:00 2001 From: Rizky Ikwan Date: Thu, 21 Aug 2025 16:18:52 +0200 Subject: [PATCH] accounts/usbwallet: correct version comparison logic (#32417) ## Description This PR fixes a bug in the Ledger hardware wallet version validation logic for EIP-155 transaction signing. The original condition incorrectly allowed older versions that don't support EIP-155 such as 0.9.9 and 0.1.5 to proceed. --- accounts/usbwallet/ledger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounts/usbwallet/ledger.go b/accounts/usbwallet/ledger.go index 2be6edd44f..52595a1621 100644 --- a/accounts/usbwallet/ledger.go +++ b/accounts/usbwallet/ledger.go @@ -166,7 +166,7 @@ func (w *ledgerDriver) SignTx(path accounts.DerivationPath, tx *types.Transactio return common.Address{}, nil, accounts.ErrWalletClosed } // Ensure the wallet is capable of signing the given transaction - if chainID != nil && w.version[0] <= 1 && w.version[1] <= 0 && w.version[2] <= 2 { + if chainID != nil && (w.version[0] < 1 || (w.version[0] == 1 && w.version[1] == 0 && w.version[2] < 3)) { //lint:ignore ST1005 brand name displayed on the console return common.Address{}, nil, fmt.Errorf("Ledger v%d.%d.%d doesn't support signing this transaction, please update to v1.0.3 at least", w.version[0], w.version[1], w.version[2]) }