-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use protobuf while communicate between peers #30
use protobuf while communicate between peers #30
Conversation
network/p2p/p2p.go
Outdated
p2p.errCh <- err | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this case the error should be logged and that's it I think. errCh
is used to send an error that terminates the app, so if there will be an error in parsing data it will result into the whole gram node to shutdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha! Also, I've noticed that some fmt.Printf
statements lack the \n
newline character. Adding it would be nice for readability. wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf
is being replaced with the logging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All LGTM, except that one thing with channel
@@ -211,6 +223,12 @@ func (p2p *P2P) p2pMessageHandler(subscription *pubsub.Subscription) { | |||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, was L221~L224 in affect? I wonder if we still need these after the last refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a node publishes a message, it has already subscribed to the relevant topic. That's why this code needed. no?
closes: #5 - Added custom logger based on ethereum logger (https://github.com/ethereum/go-ethereum/tree/master/log) - Replaced fmt occurrences with the correspondent log
No description provided.