Skip to content

Commit

Permalink
quai_api.go: SendExternalBlock remove copy
Browse files Browse the repository at this point in the history
  • Loading branch information
alanorwick committed Jul 19, 2022
1 parent 8fb5c20 commit d9a06a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion consensus/blake3/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ func (blake3 *Blake3) PreviousCoincidentOnPath(chain consensus.ChainHeaderReader
// Get previous header on local chain by hash
prevHeader := chain.GetHeaderByHash(header.ParentHash[path])
if prevHeader == nil {
fmt.Println("unable to find", prevHeader.ParentHash[path], path)
fmt.Println("unable to find", prevHeader.ParentHash, path)
return nil, consensus.ErrSubordinateNotSynced
}
// Increment previous header
Expand Down
8 changes: 6 additions & 2 deletions internal/ethapi/quai_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,10 +661,14 @@ func (s *PublicBlockChainQuaiAPI) SendExternalBlock(ctx context.Context, raw jso
}

uncles := make([]*types.Header, len(body.Uncles))
copy(uncles, body.Uncles)
for i, uncle := range body.Uncles {
uncles[i] = uncle
}

receipts := make([]*types.Receipt, len(body.Receipts))
copy(receipts, body.Receipts)
for i, receipt := range body.Receipts {
receipts[i] = receipt
}

block := types.NewExternalBlockWithHeader(head).WithBody(txs, uncles, receipts, body.Context)

Expand Down

0 comments on commit d9a06a2

Please sign in to comment.