diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-11-02 20:44:13 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-11-13 21:55:30 +0800 |
commit | 4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188 (patch) | |
tree | 5c55a3088c944ddf517aa4d7c85c5dc7f02d00e4 /ethclient | |
parent | 5cd86443ee071b5e3abe4995c777ce467c29f2c5 (diff) | |
download | dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.gz dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.bz2 dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.lz dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.xz dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.tar.zst dexon-4dca5d4db7fc2c1fac5a2e24dcc99b15573f0188.zip |
core/types, params: EIP#155
Diffstat (limited to 'ethclient')
-rw-r--r-- | ethclient/ethclient.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index 6e2b1378a..a095aa076 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -147,7 +147,7 @@ func (ec *Client) TransactionByHash(ctx context.Context, hash common.Hash) (*typ var tx *types.Transaction err := ec.c.CallContext(ctx, &tx, "eth_getTransactionByHash", hash) if err == nil { - if _, r, _ := tx.SignatureValues(); r == nil { + if _, r, _ := tx.RawSignatureValues(); r == nil { return nil, fmt.Errorf("server returned transaction without signature") } } @@ -166,7 +166,11 @@ func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash, var tx *types.Transaction err := ec.c.CallContext(ctx, &tx, "eth_getTransactionByBlockHashAndIndex", blockHash, index) if err == nil { - if _, r, _ := tx.SignatureValues(); r == nil { + var signer types.Signer = types.HomesteadSigner{} + if tx.Protected() { + signer = types.NewEIP155Signer(tx.ChainId()) + } + if _, r, _ := types.SignatureValues(signer, tx); r == nil { return nil, fmt.Errorf("server returned transaction without signature") } } |