aboutsummaryrefslogtreecommitdiffstats
path: root/ethclient
diff options
context:
space:
mode:
authorJim McDonald <Jim@mcdee.net>2017-06-21 15:53:50 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-06-21 15:53:50 +0800
commit60e27b51bc5643bc6a76151020a9e1a245340b70 (patch)
treee4c4fe10cc13d62ee093759dfff372530ca806d4 /ethclient
parent693d9ccbfbbcf7c32d3ff9fd8a432941e129a4ac (diff)
downloadgo-tangerine-60e27b51bc5643bc6a76151020a9e1a245340b70.tar
go-tangerine-60e27b51bc5643bc6a76151020a9e1a245340b70.tar.gz
go-tangerine-60e27b51bc5643bc6a76151020a9e1a245340b70.tar.bz2
go-tangerine-60e27b51bc5643bc6a76151020a9e1a245340b70.tar.lz
go-tangerine-60e27b51bc5643bc6a76151020a9e1a245340b70.tar.xz
go-tangerine-60e27b51bc5643bc6a76151020a9e1a245340b70.tar.zst
go-tangerine-60e27b51bc5643bc6a76151020a9e1a245340b70.zip
ethclient: fix TransactionByHash pending return value. (#14663)
As per #14661 TransactionByHash always returns false for pending. This uses blockNumber rather than blockHash to ensure that it returns the correct value for pending and will not suffer side-effects if eth_getTransactionByHash is fixed in future.
Diffstat (limited to 'ethclient')
-rw-r--r--ethclient/ethclient.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go
index 59f60d659..45bb87322 100644
--- a/ethclient/ethclient.go
+++ b/ethclient/ethclient.go
@@ -167,11 +167,11 @@ func (ec *Client) TransactionByHash(ctx context.Context, hash common.Hash) (tx *
} else if _, r, _ := tx.RawSignatureValues(); r == nil {
return nil, false, fmt.Errorf("server returned transaction without signature")
}
- var block struct{ BlockHash *common.Hash }
+ var block struct{ BlockNumber *string }
if err := json.Unmarshal(raw, &block); err != nil {
return nil, false, err
}
- return tx, block.BlockHash == nil, nil
+ return tx, block.BlockNumber == nil, nil
}
// TransactionCount returns the total number of transactions in the given block.