From eb92522278789ea6eda0f6f46af9a3149c9f1b11 Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Fri, 9 Jun 2017 12:39:50 +0200 Subject: mobile: use EIP155 signer for determining sender --- mobile/types.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mobile') diff --git a/mobile/types.go b/mobile/types.go index 7900e7287..02282f7a3 100644 --- a/mobile/types.go +++ b/mobile/types.go @@ -264,8 +264,11 @@ func (tx *Transaction) GetHash() *Hash { return &Hash{tx.tx.Hash()} } func (tx *Transaction) GetSigHash() *Hash { return &Hash{tx.tx.SigHash(types.HomesteadSigner{})} } func (tx *Transaction) GetCost() *BigInt { return &BigInt{tx.tx.Cost()} } -func (tx *Transaction) GetFrom() (address *Address, _ error) { - from, err := types.Sender(types.HomesteadSigner{}, tx.tx) +func (tx *Transaction) GetFrom(chainID *BigInt) (address *Address, _ error) { + if chainID == nil { // Null passed from mobile app + chainID = new(BigInt) + } + from, err := types.Sender(types.NewEIP155Signer(chainID.bigint), tx.tx) return &Address{from}, err } -- cgit v1.2.3