Skip to content

Commit

Permalink
comments added
Browse files Browse the repository at this point in the history
  • Loading branch information
hackmod committed Aug 16, 2018
1 parent c58d0fb commit 059404f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/libs/wallet/deterministic/ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ export class LedgerWallet extends HardwareWallet {
let v = result.v;
if (t._chainId > 0) {
// EIP155 support. check/recalc signature v value.
// Please see https://github.com/LedgerHQ/blue-app-eth/commit/8260268b0214810872dabd154b476f5bb859aac0
// currently, ledger returns only 1-byte truncated signatur_v
const rv = parseInt(v, 16);
let cv = t._chainId * 2 + 35;
let cv = t._chainId * 2 + 35; // calculated signature v, without signature bit.
/* tslint:disable no-bitwise */
if (rv !== cv && (rv & cv) !== rv) {
// (rv !== cv) : for v is truncated byte case
// (rv & cv): make cv to truncated byte
// (rv & cv) !== rv: signature v bit needed
cv += 1; // add signature v bit.
}
v = cv.toString(16);
Expand Down

0 comments on commit 059404f

Please sign in to comment.