mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/rawdb: resolving code redundancy
This commit is contained in:
parent
509a64ffb9
commit
ff8286eb3b
2 changed files with 4 additions and 13 deletions
|
|
@ -681,15 +681,6 @@ func DeleteReceipts(db ethdb.KeyValueWriter, hash common.Hash, number uint64) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// storedReceiptRLP is the storage encoding of a receipt.
|
|
||||||
// Re-definition in core/types/receipt.go.
|
|
||||||
// TODO: Re-use the existing definition.
|
|
||||||
type storedReceiptRLP struct {
|
|
||||||
PostStateOrStatus []byte
|
|
||||||
CumulativeGasUsed uint64
|
|
||||||
Logs []*types.Log
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReceiptLogs is a barebone version of ReceiptForStorage which only keeps
|
// ReceiptLogs is a barebone version of ReceiptForStorage which only keeps
|
||||||
// the list of logs. When decoding a stored receipt into this object we
|
// the list of logs. When decoding a stored receipt into this object we
|
||||||
// avoid creating the bloom filter.
|
// avoid creating the bloom filter.
|
||||||
|
|
@ -699,7 +690,7 @@ type receiptLogs struct {
|
||||||
|
|
||||||
// DecodeRLP implements rlp.Decoder.
|
// DecodeRLP implements rlp.Decoder.
|
||||||
func (r *receiptLogs) DecodeRLP(s *rlp.Stream) error {
|
func (r *receiptLogs) DecodeRLP(s *rlp.Stream) error {
|
||||||
var stored storedReceiptRLP
|
var stored types.StoredReceiptRLP
|
||||||
if err := s.Decode(&stored); err != nil {
|
if err := s.Decode(&stored); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ type receiptRLP struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// storedReceiptRLP is the storage encoding of a receipt.
|
// storedReceiptRLP is the storage encoding of a receipt.
|
||||||
type storedReceiptRLP struct {
|
type StoredReceiptRLP struct {
|
||||||
PostStateOrStatus []byte
|
PostStateOrStatus []byte
|
||||||
CumulativeGasUsed uint64
|
CumulativeGasUsed uint64
|
||||||
Logs []*Log
|
Logs []*Log
|
||||||
|
|
@ -282,7 +282,7 @@ func (r *ReceiptForStorage) EncodeRLP(_w io.Writer) error {
|
||||||
// DecodeRLP implements rlp.Decoder, and loads both consensus and implementation
|
// DecodeRLP implements rlp.Decoder, and loads both consensus and implementation
|
||||||
// fields of a receipt from an RLP stream.
|
// fields of a receipt from an RLP stream.
|
||||||
func (r *ReceiptForStorage) DecodeRLP(s *rlp.Stream) error {
|
func (r *ReceiptForStorage) DecodeRLP(s *rlp.Stream) error {
|
||||||
var stored storedReceiptRLP
|
var stored StoredReceiptRLP
|
||||||
if err := s.Decode(&stored); err != nil {
|
if err := s.Decode(&stored); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue