mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-06 21:14:27 +00:00
accounts/usbwallet: simplify code using -= operator (#17904)
This commit is contained in:
parent
c0acd9c3ad
commit
b469d70433
2 changed files with 2 additions and 2 deletions
|
|
@ -351,7 +351,7 @@ func (w *ledgerDriver) ledgerSign(derivationPath []uint32, tx *types.Transaction
|
||||||
signer = new(types.HomesteadSigner)
|
signer = new(types.HomesteadSigner)
|
||||||
} else {
|
} else {
|
||||||
signer = types.NewEIP155Signer(chainID)
|
signer = types.NewEIP155Signer(chainID)
|
||||||
signature[crypto.RecoveryIDOffset] = signature[crypto.RecoveryIDOffset] - byte(chainID.Uint64()*2+35)
|
signature[crypto.RecoveryIDOffset] -= byte(chainID.Uint64()*2+35)
|
||||||
}
|
}
|
||||||
signed, err := tx.WithSignature(signer, signature)
|
signed, err := tx.WithSignature(signer, signature)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ func (w *trezorDriver) trezorSign(derivationPath []uint32, tx *types.Transaction
|
||||||
} else {
|
} else {
|
||||||
// Trezor backend does not support typed transactions yet.
|
// Trezor backend does not support typed transactions yet.
|
||||||
signer = types.NewEIP155Signer(chainID)
|
signer = types.NewEIP155Signer(chainID)
|
||||||
signature[crypto.RecoveryIDOffset] = signature[crypto.RecoveryIDOffset] - byte(chainID.Uint64()*2+35)
|
signature[crypto.RecoveryIDOffset] -= byte(chainID.Uint64()*2+35)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inject the final signature into the transaction and sanity check the sender
|
// Inject the final signature into the transaction and sanity check the sender
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue