diff --git a/eth/protocols/eth/receipt.go b/eth/protocols/eth/receipt.go index e51c02fa2a..96e8c4399b 100644 --- a/eth/protocols/eth/receipt.go +++ b/eth/protocols/eth/receipt.go @@ -194,18 +194,12 @@ func (rl *ReceiptList) EncodeForStorage() (rlp.RawValue, error) { // Derivable returns a DerivableList, which can be used to decode func (rl *ReceiptList) Derivable() types.DerivableList { var bloomBuf [6]byte - write := writeReceiptForHash(&bloomBuf) - return newDerivableRawList(&rl.items, write) -} - -// writeReceiptForHash returns a write function that encodes receipts for hash derivation. -func writeReceiptForHash(bloomBuf *[6]byte) func([]byte, *bytes.Buffer) { - return func(data []byte, outbuf *bytes.Buffer) { + return newDerivableRawList(&rl.items, func(data []byte, outbuf *bytes.Buffer) { var r Receipt if r.decode(data) == nil { - r.encodeForHash(bloomBuf, outbuf) + r.encodeForHash(&bloomBuf, outbuf) } - } + }) } // blockReceiptsToNetwork takes a slice of rlp-encoded receipts, and transactions,