Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Commit

Permalink
trezor: for some larger chainId, Trezor returns only signature_v bit.…
Browse files Browse the repository at this point in the history
… simply recalc signature_v
  • Loading branch information
hackmod committed Aug 14, 2018
1 parent c11a14f commit 288bd35
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/scripts/uiFuncs.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ uiFuncs.signTxTrezor = function(rawTx, txData, callback) {
return;
}

// check the returned signature_v and recalc signature_v if it needed
// see also https://github.com/trezor/trezor-mcu/pull/399
if (result.v <= 1) {
// for larger chainId, only signature_v returned. simply recalc signature_v
result.v += 2 * rawTx.chainId + 35;
}

rawTx.v = "0x" + ethFuncs.decimalToHex(result.v);
rawTx.r = "0x" + result.r;
rawTx.s = "0x" + result.s;
Expand Down

0 comments on commit 288bd35

Please sign in to comment.