/ buffer / read.go
read.go
 1  package buffer
 2  
 3  import (
 4  	"github.com/lightningnetwork/lnd/lnwire"
 5  )
 6  
 7  // ReadSize represents the size of the maximum message that can be read off the
 8  // wire by brontide. The buffer is used to hold the ciphertext while the
 9  // brontide state machine decrypts the message.
10  const ReadSize = lnwire.MaxSliceLength + 16
11  
12  // Read is a static byte array sized to the maximum-allowed Lightning message
13  // size, plus 16 bytes for the MAC.
14  type Read [ReadSize]byte
15  
16  // Recycle zeroes the Read, making it fresh for another use.
17  func (b *Read) Recycle() {
18  	RecycleSlice(b[:])
19  }