Skip to content

Commit b0996a2

Browse files
accounts/usbwallet: correct version comparison logic ethereum#32417 (#1430)
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. Co-authored-by: Rizky Ikwan <rizzikwann@gmail.com>
1 parent 8c4863a commit b0996a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

accounts/usbwallet/ledger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (w *ledgerDriver) SignTx(path accounts.DerivationPath, tx *types.Transactio
166166
return common.Address{}, nil, accounts.ErrWalletClosed
167167
}
168168
// Ensure the wallet is capable of signing the given transaction
169-
if chainID != nil && w.version[0] <= 1 && w.version[1] <= 0 && w.version[2] <= 2 {
169+
if chainID != nil && (w.version[0] < 1 || (w.version[0] == 1 && w.version[1] == 0 && w.version[2] < 3)) {
170170
//lint:ignore ST1005 brand name displayed on the console
171171
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])
172172
}

0 commit comments

Comments
 (0)