mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-07 05:07:36 +00:00
Tweaks for network and storage (#66)
* Made Encode/Decode message public. * Added Redis storage driver and made some optimizations for the initialising the blockchain * removed log lines in tcp_peer * Added missing comments on exported methods. * bumped version
This commit is contained in:
parent
5b5a7106c1
commit
b2021c126e
12 changed files with 220 additions and 93 deletions
|
@ -124,8 +124,8 @@ func (m *Message) CommandType() CommandType {
|
|||
}
|
||||
}
|
||||
|
||||
// decode a Message from the given reader.
|
||||
func (m *Message) decode(r io.Reader) error {
|
||||
// Decode a Message from the given reader.
|
||||
func (m *Message) Decode(r io.Reader) error {
|
||||
if err := binary.Read(r, binary.LittleEndian, &m.Magic); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -205,8 +205,8 @@ func (m *Message) decodePayload(r io.Reader) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// encode a Message to any given io.Writer.
|
||||
func (m *Message) encode(w io.Writer) error {
|
||||
// Encode a Message to any given io.Writer.
|
||||
func (m *Message) Encode(w io.Writer) error {
|
||||
if err := binary.Write(w, binary.LittleEndian, m.Magic); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue