aboutsummaryrefslogtreecommitdiffstats
path: root/ethclient
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-11-14 17:52:02 +0800
committerGitHub <noreply@github.com>2016-11-14 17:52:02 +0800
commitca73dea3b9bcdf3b5424b5c48c70817439e2e304 (patch)
tree670e2833878e72555644fbbd81db6c5a1b44493f /ethclient
parent21701190ac0a838e347f31b7a918bb0a60c1e8c1 (diff)
parent648bd22427000b6e20a5e1a9c397005aa1ad4f9b (diff)
downloaddexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar.gz
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar.bz2
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar.lz
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar.xz
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.tar.zst
dexon-ca73dea3b9bcdf3b5424b5c48c70817439e2e304.zip
Merge pull request #3179 from obscuren/eip-158
EIP158 & 160 Hardfork
Diffstat (limited to 'ethclient')
-rw-r--r--ethclient/ethclient.go8
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")
}
}