lnwire: use write buffer in Encode methods
This commit changes the WriteElement and WriteElements methods to take a write buffer instead of io.Writer. The corresponding Encode methods are changed to use the write buffer.
This commit is contained in:
36 files changed
+139
-76
No files matched your search
@@ -1,6 +1,9 @@
|
||||
package lnwire
|
||||
|
||||
import "io"
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
)
|
||||
|
||||
// FundingSigned is sent from Bob (the responder) to Alice (the initiator)
|
||||
// after receiving the funding outpoint and her signature for Bob's version of
|
||||
@@ -29,7 +32,7 @@ var _ Message = (*FundingSigned)(nil)
|
||||
// protocol version.
|
||||
//
|
||||
// This is part of the lnwire.Message interface.
|
||||
func (f *FundingSigned) Encode(w io.Writer, pver uint32) error {
|
||||
func (f *FundingSigned) Encode(w *bytes.Buffer, pver uint32) error {
|
||||
return WriteElements(w, f.ChanID, f.CommitSig, f.ExtraData)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user