accounts/usbwallet: fix sender derivation for new types

This commit is contained in:
Martin Holst Swende 2024-11-08 14:39:41 +01:00
parent 54cc1e6d16
commit 6680d76077
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -397,8 +397,8 @@ func (w *ledgerDriver) ledgerSign(derivationPath []uint32, tx *types.Transaction
if chainID == nil { if chainID == nil {
signer = new(types.HomesteadSigner) signer = new(types.HomesteadSigner)
} else { } else {
signer = types.NewEIP155Signer(chainID) signer = types.LatestSignerForChainID(chainID)
// For EIP-1559 Tx, the V value is 0 or 1, so you don't need to subtract // For non-legacy transactions, V is 0 or 1, no need to subtract here.
if tx.Type() == types.LegacyTxType { if tx.Type() == types.LegacyTxType {
signature[64] -= byte(chainID.Uint64()*2 + 35) signature[64] -= byte(chainID.Uint64()*2 + 35)
} }