diff options
Diffstat (limited to 'eth/protocol.go')
-rw-r--r-- | eth/protocol.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/eth/protocol.go b/eth/protocol.go index 49f096a3b..24007bbb5 100644 --- a/eth/protocol.go +++ b/eth/protocol.go @@ -213,6 +213,22 @@ type blockBody struct { // blockBodiesData is the network packet for block content distribution. type blockBodiesData []*blockBody +// blockBodyRLP represents the RLP encoded data content of a single block. +type blockBodyRLP []byte + +// EncodeRLP is a specialized encoder for a block body to pass the already +// encoded body RLPs from the database on, without double encoding. +func (b *blockBodyRLP) EncodeRLP(w io.Writer) error { + if _, err := w.Write([]byte(*b)); err != nil { + return err + } + return nil +} + +// blockBodiesRLPData is the network packet for block content distribution +// based on original RLP formatting (i.e. skip the db-decode/proto-encode). +type blockBodiesRLPData []*blockBodyRLP + // nodeDataData is the network response packet for a node data retrieval. type nodeDataData []struct { Value []byte |