diff options
author | bas-vk <bas-vk@users.noreply.github.com> | 2017-01-21 06:32:16 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-01-21 06:32:16 +0800 |
commit | 0126d014351bc4f58e2d7e6564a054fb80f87153 (patch) | |
tree | e1af30aa2d59a3e012d004d73d90010d9794abe1 /core/types/transaction.go | |
parent | 946db8ba6547e5b18c5af701eb0e9e49a4298cbe (diff) | |
download | go-tangerine-0126d014351bc4f58e2d7e6564a054fb80f87153.tar go-tangerine-0126d014351bc4f58e2d7e6564a054fb80f87153.tar.gz go-tangerine-0126d014351bc4f58e2d7e6564a054fb80f87153.tar.bz2 go-tangerine-0126d014351bc4f58e2d7e6564a054fb80f87153.tar.lz go-tangerine-0126d014351bc4f58e2d7e6564a054fb80f87153.tar.xz go-tangerine-0126d014351bc4f58e2d7e6564a054fb80f87153.tar.zst go-tangerine-0126d014351bc4f58e2d7e6564a054fb80f87153.zip |
types: bugfix invalid V derivation on tx json unmarshal (#3594)
Diffstat (limited to 'core/types/transaction.go')
-rw-r--r-- | core/types/transaction.go | 3 |
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) } |