mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
ethclient: change Hash field of rpcBlock to pointer
This commit is contained in:
parent
701df4baad
commit
ad5d463ceb
1 changed files with 3 additions and 3 deletions
|
|
@ -131,7 +131,7 @@ func (ec *Client) BlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumb
|
||||||
}
|
}
|
||||||
|
|
||||||
type rpcBlock struct {
|
type rpcBlock struct {
|
||||||
Hash common.Hash `json:"hash"`
|
Hash *common.Hash `json:"hash"`
|
||||||
Transactions []rpcTransaction `json:"transactions"`
|
Transactions []rpcTransaction `json:"transactions"`
|
||||||
UncleHashes []common.Hash `json:"uncles"`
|
UncleHashes []common.Hash `json:"uncles"`
|
||||||
Withdrawals []*types.Withdrawal `json:"withdrawals,omitempty"`
|
Withdrawals []*types.Withdrawal `json:"withdrawals,omitempty"`
|
||||||
|
|
@ -198,8 +198,8 @@ func (ec *Client) getBlock(ctx context.Context, method string, args ...interface
|
||||||
// Fill the sender cache of transactions in the block.
|
// Fill the sender cache of transactions in the block.
|
||||||
txs := make([]*types.Transaction, len(body.Transactions))
|
txs := make([]*types.Transaction, len(body.Transactions))
|
||||||
for i, tx := range body.Transactions {
|
for i, tx := range body.Transactions {
|
||||||
if tx.From != nil {
|
if tx.From != nil && body.Hash != nil {
|
||||||
setSenderFromServer(tx.tx, *tx.From, body.Hash)
|
setSenderFromServer(tx.tx, *tx.From, *body.Hash)
|
||||||
}
|
}
|
||||||
txs[i] = tx.tx
|
txs[i] = tx.tx
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue