Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions p2p/protocols/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,18 @@ func (p *Peer) Send(ctx context.Context, msg interface{}) error {
}
size = len(r)
}

err = p2p.Send(p.rw, code, wmsg)
if err != nil {
return err
}

// if the accounting hook is set, call it
if p.spec.Hook != nil {
err = p.spec.Hook.Send(p, uint32(size), msg)
if err != nil {
return err
}
}

return p2p.Send(p.rw, code, wmsg)
return err
}

// handleIncoming(code)
Expand Down