aboutsummaryrefslogtreecommitdiffstats
path: root/core/types/transaction.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/types/transaction.go')
-rw-r--r--core/types/transaction.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/types/transaction.go b/core/types/transaction.go
index e610671d3..0b6d24268 100644
--- a/core/types/transaction.go
+++ b/core/types/transaction.go
@@ -198,7 +198,8 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
var V byte
if isProtectedV((*big.Int)(dec.V)) {
- V = byte((new(big.Int).Sub((*big.Int)(dec.V), deriveChainId((*big.Int)(dec.V))).Uint64()) - 35)
+ chainId := deriveChainId((*big.Int)(dec.V)).Uint64()
+ V = byte(dec.V.ToInt().Uint64() - 35 - 2*chainId)
} else {
V = byte(((*big.Int)(dec.V)).Uint64() - 27)
}