mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
This commit is contained in:
parent
9ad6312396
commit
e6f85271a3
1 changed files with 7 additions and 6 deletions
|
|
@ -253,12 +253,13 @@ func (ec *Client) TransactionCount(ctx context.Context, blockHash common.Hash) (
|
|||
func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error) {
|
||||
var json *rpcTransaction
|
||||
err := ec.c.CallContext(ctx, &json, "eth_getTransactionByBlockHashAndIndex", blockHash, hexutil.Uint64(index))
|
||||
if err == nil {
|
||||
if json == nil {
|
||||
return nil, ethereum.ErrNotFound
|
||||
} else if _, r, _ := json.tx.RawSignatureValues(); r == nil {
|
||||
return nil, errors.New("server returned transaction without signature")
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if json == nil {
|
||||
return nil, ethereum.ErrNotFound
|
||||
} else if _, r, _ := json.tx.RawSignatureValues(); r == nil {
|
||||
return nil, errors.New("server returned transaction without signature")
|
||||
}
|
||||
if json.From != nil && json.BlockHash != nil {
|
||||
setSenderFromServer(json.tx, *json.From, *json.BlockHash)
|
||||
|
|
|
|||
Loading…
Reference in a new issue