mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 11:41:48 +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
|
@ -38,7 +38,7 @@ func NewTCPPeer(conn net.Conn, proto chan protoTuple) *TCPPeer {
|
|||
// Send implements the Peer interface. This will encode the message
|
||||
// to the underlying connection.
|
||||
func (p *TCPPeer) Send(msg *Message) {
|
||||
if err := msg.encode(p.conn); err != nil {
|
||||
if err := msg.Encode(p.conn); err != nil {
|
||||
select {
|
||||
case p.disc <- err:
|
||||
case <-p.closed:
|
||||
|
@ -71,7 +71,7 @@ func (p *TCPPeer) readLoop(proto chan protoTuple, readErr chan error) {
|
|||
return
|
||||
default:
|
||||
msg := &Message{}
|
||||
if err := msg.decode(p.conn); err != nil {
|
||||
if err := msg.Decode(p.conn); err != nil {
|
||||
readErr <- err
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue