diff --git a/core/types/receipt.go b/core/types/receipt.go index 68dc6ab98..554513505 100644 --- a/core/types/receipt.go +++ b/core/types/receipt.go @@ -432,10 +432,10 @@ func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) { func (r Receipts) DeriveFields(hash common.Hash, number uint64, txs Transactions, senders []common.Address) error { logIndex := uint(0) // logIdx is unique within the block and starts from 0 if len(txs) != len(r) { - return errors.New("transaction and receipt count mismatch") + return fmt.Errorf("transaction and receipt count mismatch, tx count = %d, receipts count = %d", len(txs), len(r)) } if len(senders) != len(txs) { - return errors.New("transaction and senders count mismatch") + return fmt.Errorf("transaction and senders count mismatch, tx count = %d, receipts count = %d", len(txs), len(r)) } for i := 0; i < len(r); i++ { // The transaction type and hash can be retrieved from the transaction itself diff --git a/ethdb/privateapi/ethbackend.go b/ethdb/privateapi/ethbackend.go index d43667226..ce99eeaf4 100644 --- a/ethdb/privateapi/ethbackend.go +++ b/ethdb/privateapi/ethbackend.go @@ -216,8 +216,8 @@ func (s *EthBackendServer) Block(ctx context.Context, req *remote.BlockRequest) return nil, err } sendersBytes := make([]byte, 20*len(senders)) - for i := range senders { - sendersBytes = append(sendersBytes, senders[i][:]...) + for i, sender := range senders { + copy(sendersBytes[i*20:], sender[:]) } return &remote.BlockReply{BlockRlp: blockRlp, Senders: sendersBytes}, nil }