Commit 5b4c4822 authored by Sebastian Stammler's avatar Sebastian Stammler

op-node: Add ChannelOut.InputBytes

parent 19ad0f88
...@@ -98,6 +98,11 @@ func (co *ChannelOut) AddBlock(block *types.Block) (uint64, error) { ...@@ -98,6 +98,11 @@ func (co *ChannelOut) AddBlock(block *types.Block) (uint64, error) {
return uint64(written), err return uint64(written), err
} }
// InputBytes returns the total amount of RLP-encoded input bytes.
func (co *ChannelOut) InputBytes() int {
return co.rlpLength
}
// ReadyBytes returns the number of bytes that the channel out can immediately output into a frame. // ReadyBytes returns the number of bytes that the channel out can immediately output into a frame.
// Use `Flush` or `Close` to move data from the compression buffer into the ready buffer if more bytes // Use `Flush` or `Close` to move data from the compression buffer into the ready buffer if more bytes
// are needed. Add blocks may add to the ready buffer, but it is not guaranteed due to the compression stage. // are needed. Add blocks may add to the ready buffer, but it is not guaranteed due to the compression stage.
...@@ -154,7 +159,7 @@ func (co *ChannelOut) OutputFrame(w *bytes.Buffer, maxSize uint64) (uint16, erro ...@@ -154,7 +159,7 @@ func (co *ChannelOut) OutputFrame(w *bytes.Buffer, maxSize uint64) (uint16, erro
} }
co.frame += 1 co.frame += 1
fn := uint16(f.FrameNumber) fn := f.FrameNumber
if f.IsLast { if f.IsLast {
return fn, io.EOF return fn, io.EOF
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment